home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 112 (1989-11-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 112 (1989-11-15)(Ossowski, Stefan)(DE)(PD).adf / VirusControl / VIRUS-CONTROL.s < prev   
Text File  |  1989-07-02  |  93KB  |  2,896 lines

  1. ; Pius Nippgen, Bergstr.12, D-6657 Gersheim 8, Tel. 06843/781 (06843/1522)
  2. ; WEST-GERMANY
  3.  
  4. ; VIRUS-CONTROL V1.3  -  Sourcecode:
  5. ; ---------------------------------
  6. ; Sorry for my poor school-English
  7. ; done with SEKA-Assembler.
  8. ; 05. May 1989
  9.  
  10. start:
  11.  move.l  $4.w,a6
  12.  movem.l d0/a0,Parameter   ; save address + number of additional characters
  13.  sub.l   a1,a1             ; FindTask() (or process)
  14.  jsr     -294(a6)
  15.  move.l  d0,a1
  16.  tst.l   $ac(a1)           ; pointer to ConsoleLineInterpreter = 0 ->
  17.  bne.s   clistart          ; Workbenchstart -> you have to get Workbench-
  18.  move.l  d0,-(sp)          ; StartupMessage, else -> TaskHeld or Guru
  19.  lea     $5c(a1),a0
  20.  jsr     -384(a6)          ; WaitPort()
  21.  move.l  (sp)+,a1
  22.  lea     $5c(a1),a0
  23.  jsr     -372(a6)          ; GetMsg()
  24.  move.l  d0,-(sp)
  25.  lea     NOBOOTRtext(pc),a0
  26.  add.l   #reset,-8(a0)
  27.  add.l   #reset,-12(a0)
  28.  lea     NoWBStart(pc),a1
  29.  lea     NOBOOTR(pc),a2
  30.  lea     NOBOOTR(pc),a3    ; Requester points to CLI-Start
  31.  bsr     autorequest
  32.  sub.l   #reset,-8(a0)
  33.  sub.l   #reset,-12(a0)
  34.  move.l  (sp)+,a1
  35.  jmp     -378(a6)          ; ReplyMsg() + end
  36. clistart:
  37.  move.l  #end-reset+9000,d0; real VIRUS-CONTROL-Routine + Task-stack
  38.  move.l  #$10002,d1        ; MEMF_CLEAR
  39.  jsr     -198(a6)          ; Chip-Memory exists in any Amiga, and can be
  40.  move.l  d0,pointer        ; allocated already in Cool-vector-routine
  41.  beq     weiter-2          ; error -> rts -> no installation-information
  42.  move.l  -454(a6),oldDOIO  ; save oldDOIO, will be copied
  43.  tst.l   546(a6)
  44.  bne.s   kickchanged
  45.  tst.l   550(a6)        ; if KICK-vectors are changed -> only warnings,
  46.  bne.s   kickchanged    ; because changes can be caused by serious programs
  47.  tst.l   554(a6)        ; (for instance rad:)
  48.  beq.s   testBeginIO
  49. kickchanged:
  50.  move.l  #MeldungvectorEnde-Meldungvector,textlaenge
  51.  move.l  #Meldungvector,textaddress
  52.  bsr     meldungout
  53. testBeginIO:
  54.  lea     350(a6),a0     ; DeviceListstructure
  55.  lea     trackdisk(pc),a1
  56.  jsr     -276(a6)       ; Address of Trackdisk-Node = trackdisk.device-Base
  57.  move.l  d0,a0
  58.  lea     -28(a0),a0
  59.  move.l  a0,BeginIOAdr  ; get addresse of BeginIO-vector
  60.  cmp.l   #$00fc0000,(a0); if BeginIO-vector is changed -> only warning, because
  61.  bhs.s   testDOIO       ; changes can be caused by serious programs (FACC)
  62.  move.l  #MeldungvectorEnde-Meldungvector,textlaenge
  63.  move.l  #Meldungvector,textaddress
  64.  move.l  #"Begi",Meldungvector+4
  65.  move.l  #"nIO-",Meldungvector+8
  66.  bsr     meldungout
  67. testDOIO:
  68.  lea     newDOIO(pc),a0
  69.  move.l  oldDOIO(pc),a3 ; is DOIO-vector already set to VIRUS-CONTROL
  70.  moveq   #127,d0        ; if not install VIRUS-CONTROL, but only if DOIO-vector
  71. aaaa:                   ; was not changed
  72.  cmpm.l  (a3)+,(a0)+
  73.  bne.s   install
  74.  dbra    d0,aaaa        ; VIRUS-CONTROL already installed, because DOIO okay
  75.  
  76.  lea     reset(pc),a0   ; test if COOL-vector is set to VIRUS-CONTROL
  77.  move.l  46(a6),a3      ; test 127 Bytes (moveq -> +127)
  78.  moveq   #127,d0
  79. bbbb:
  80.  cmpm.l  (a3)+,(a0)+
  81.  bne     COOLchanged    ; is Cool-vector set to another program (Virus?)
  82.  dbra    d0,bbbb
  83.  bra     isinstalled    ; both vectors set to VIRUS-CONTROL -> everthing okay
  84. install:
  85.  cmp.l   #$00fc0000,oldDOIO; is DOIO-vector set to ROM ?
  86.  ; do not use a special ROM-address, because of compatibility with any version
  87.  ; if not set to ROM -> set to a virus ?
  88.  blo     DOIOchanged
  89.  movem.l d1-d7/a0-a6,-(sp)
  90.  lea     taskname(pc),a1; vector-control-Task could be active still, because
  91.  jsr     -294(a6)       ; a Window or Requester could be still in work
  92.  tst.l   d0             ; DOIO, COOL-vector is restored already.
  93.  movem.l (sp)+,d1-d7/a0-a6
  94.  bne     freemem
  95.  move.l  pointer(pc),a1 ; a1 will be used in copy-routine
  96.  move.l  a1,d0
  97.  lea     Kennung(pc),a0 ; VIRUS-CONTROL-program can be file-proteced too,
  98.  addq.b  #1,8(a0)       ; because mark does not stand in program
  99.  lea     NOBOOT(pc),a0
  100.  add.l   d0,lastDOIO       -NOBOOT(a0)    ; assemble absolute addresses with
  101.  add.l   d0,lastCOOL       -NOBOOT(a0)    ; minus reset.
  102.  add.l   d0,NOBOOTtext     -NOBOOT-8(a0)  ; now adapt these absolute addresses
  103.  add.l   d0,NOBOOTtext     -NOBOOT-12(a0) ; to the actual memory-address
  104.  add.l   d0,NOBOOTRtext    -NOBOOT-8(a0)
  105.  add.l   d0,NOBOOTRtext    -NOBOOT-12(a0)
  106.  add.l   d0,OPENERRtext    -NOBOOT-8(a0)
  107.  add.l   d0,OPENERRtext    -NOBOOT-12(a0)
  108.  add.l   d0,NAME0text      -NOBOOT-8(a0)
  109.  add.l   d0,NAME0text      -NOBOOT-12(a0)
  110.  add.l   d0,NAME1text      -NOBOOT-8(a0)
  111.  add.l   d0,NAME1text      -NOBOOT-12(a0)
  112.  add.l   d0,NAME2text      -NOBOOT-8(a0)
  113.  add.l   d0,NAME2text      -NOBOOT-12(a0)
  114.  add.l   d0,NAME3text      -NOBOOT-8(a0)
  115.  add.l   d0,NAME3text      -NOBOOT-12(a0)
  116.  add.l   d0,ONEDIFFtext    -NOBOOT-8(a0)
  117.  add.l   d0,ONEDIFFtext    -NOBOOT-12(a0)
  118.  add.l   d0,CORRECTtext    -NOBOOT-8(a0)
  119.  add.l   d0,CORRECTtext    -NOBOOT-12(a0)
  120.  add.l   d0,PROTECTtext    -NOBOOT-8(a0)
  121.  add.l   d0,PROTECTLtext   -NOBOOT-8(a0)
  122.  add.l   d0,ALREADYNOtext  -NOBOOT-8(a0)
  123.  add.l   d0,ALREADYNOdeltext-NOBOOT-8(a0)
  124.  add.l   d0,ALREADYVItext  -NOBOOT-8(a0)
  125.  add.l   d0,ALREADYVItext  -NOBOOT-12(a0)
  126.  add.l   d0,ALREADYWORKtext-NOBOOT-8(a0)
  127.  add.l   d0,ALREADYNOnamtext-NOBOOT-8(a0)
  128.  add.l   d0,ALREADYNOnamtext-NOBOOT-12(a0)
  129.  add.l   d0,OPENFILEnamtext-NOBOOT-8(a0)
  130.  add.l   d0,OPENFILEnamtext-NOBOOT-12(a0)
  131.  add.l   d0,EXITtext       -NOBOOT-8(a0)
  132.  add.l   d0,linktext       -NOBOOT-8(a0)
  133.  add.l   d0,linktext       -NOBOOT-12(a0)
  134.  add.l   d0,neuschtext     -NOBOOT-8(a0)
  135.  add.l   d0,okktext        -NOBOOT-8(a0)
  136.  add.l   d0,noloadftext    -NOBOOT-8(a0)
  137.  add.l   d0,FILESCHUTZtext -NOBOOT-8(a0)
  138.  add.l   d0,WRITEBBtext    -NOBOOT-8(a0)
  139.  add.l   d0,WRITEBBtext    -NOBOOT-12(a0)
  140.  add.l   d0,OVERWRITEtext  -NOBOOT-8(a0)
  141.  add.l   d0,OVERWRITELtext -NOBOOT-8(a0)
  142.  add.l   d0,OVERWRITERtext -NOBOOT-8(a0)
  143.  add.l   d0,BOOTL          -NOBOOT-8(a0)
  144.  add.l   d0,BOOTLtext      -NOBOOT-8(a0)
  145.  add.l   d0,BOOTRtext      -NOBOOT-8(a0)
  146.  add.l   d0,REALLYBOOTtext -NOBOOT-8(a0)
  147.  add.l   d0,vector0text    -NOBOOT-8(a0)
  148.  add.l   d0,vectorLtext    -NOBOOT-8(a0)
  149.  add.l   d0,vectorLtext    -NOBOOT-12(a0)
  150.  add.l   d0,gadtext16text  -NOBOOT-8(a0)
  151.  add.l   d0,gadtext16text  -NOBOOT-12(a0)
  152.  add.l   d0,gadtext15text  -NOBOOT-8(a0)
  153.  add.l   d0,gadtext15text  -NOBOOT-12(a0)
  154.  add.l   d0,gadtext14text  -NOBOOT-8(a0)
  155.  add.l   d0,gadtext14text  -NOBOOT-12(a0)
  156.  add.l   d0,gadtext13text  -NOBOOT-8(a0)
  157.  add.l   d0,gadtext13text  -NOBOOT-12(a0)
  158.  add.l   d0,gadtext12text  -NOBOOT-8(a0)
  159.  add.l   d0,gadtext12text  -NOBOOT-12(a0)
  160.  add.l   d0,gadtext11text  -NOBOOT-8(a0)
  161.  add.l   d0,gadtext11text  -NOBOOT-12(a0)
  162.  add.l   d0,gadtext8text   -NOBOOT-8(a0)
  163.  add.l   d0,gadtext8text   -NOBOOT-12(a0)
  164.  add.l   d0,gadtext7text   -NOBOOT-8(a0)
  165.  add.l   d0,gadtext7text   -NOBOOT-12(a0)
  166.  add.l   d0,gadtext6text   -NOBOOT-8(a0)
  167.  add.l   d0,gadtext6text   -NOBOOT-12(a0)
  168.  add.l   d0,gadtext5text   -NOBOOT-8(a0)
  169.  add.l   d0,gadtext5text   -NOBOOT-12(a0)
  170.  add.l   d0,gadtext4text   -NOBOOT-8(a0)
  171.  add.l   d0,gadtext4text   -NOBOOT-12(a0)
  172.  add.l   d0,gadtext3text   -NOBOOT-8(a0)
  173.  add.l   d0,gadtext3text   -NOBOOT-12(a0)
  174.  add.l   d0,gadtext2text   -NOBOOT-8(a0)
  175.  add.l   d0,gadtext2text   -NOBOOT-12(a0)
  176.  add.l   d0,gadtext1text   -NOBOOT-8(a0)
  177.  add.l   d0,gadtext1text   -NOBOOT-12(a0)
  178.  add.l   d0,gadtext0text   -NOBOOT-8(a0)
  179.  add.l   d0,gadtext0text   -NOBOOT-12(a0)
  180.  add.l   d0,gad90          -NOBOOT(a0)
  181.  add.l   d0,gad90          -NOBOOT+18(a0)
  182.  add.l   d0,gad90          -NOBOOT+34(a0)
  183.  add.l   d0,string0        -NOBOOT(a0)
  184.  add.l   d0,string0        -NOBOOT+4(a0)
  185.  add.l   d0,gad91          -NOBOOT(a0)
  186.  add.l   d0,gad91          -NOBOOT+18(a0)
  187.  add.l   d0,gad91          -NOBOOT+34(a0)
  188.  add.l   d0,string1        -NOBOOT(a0)
  189.  add.l   d0,string1        -NOBOOT+4(a0)
  190.  add.l   d0,gad92          -NOBOOT(a0)
  191.  add.l   d0,gad92          -NOBOOT+18(a0)
  192.  add.l   d0,gad92          -NOBOOT+34(a0)
  193.  add.l   d0,string2        -NOBOOT(a0)
  194.  add.l   d0,string2        -NOBOOT+4(a0)
  195.  add.l   d0,gad93          -NOBOOT(a0)
  196.  add.l   d0,gad93          -NOBOOT+18(a0)
  197.  add.l   d0,gad93          -NOBOOT+34(a0)
  198.  add.l   d0,string3        -NOBOOT(a0)
  199.  add.l   d0,string3        -NOBOOT+4(a0)
  200.  add.l   d0,gad0           -NOBOOT(a0)
  201.  add.l   d0,gad0           -NOBOOT+18(a0)
  202.  add.l   d0,gad0           -NOBOOT+26(a0)
  203.  add.l   d0,gad1           -NOBOOT(a0)
  204.  add.l   d0,gad1           -NOBOOT+18(a0)
  205.  add.l   d0,gad1           -NOBOOT+26(a0)
  206.  add.l   d0,gad2           -NOBOOT(a0)
  207.  add.l   d0,gad2           -NOBOOT+18(a0)
  208.  add.l   d0,gad2           -NOBOOT+26(a0)
  209.  add.l   d0,gad3           -NOBOOT(a0)
  210.  add.l   d0,gad3           -NOBOOT+18(a0)
  211.  add.l   d0,gad3           -NOBOOT+26(a0)
  212.  add.l   d0,gad4           -NOBOOT(a0)
  213.  add.l   d0,gad4           -NOBOOT+18(a0)
  214.  add.l   d0,gad4           -NOBOOT+26(a0)
  215.  add.l   d0,gad5           -NOBOOT(a0)
  216.  add.l   d0,gad5           -NOBOOT+18(a0)
  217.  add.l   d0,gad5           -NOBOOT+26(a0)
  218.  add.l   d0,gad6           -NOBOOT(a0)
  219.  add.l   d0,gad6           -NOBOOT+18(a0)
  220.  add.l   d0,gad6           -NOBOOT+26(a0)
  221.  add.l   d0,gad7           -NOBOOT(a0)
  222.  add.l   d0,gad7           -NOBOOT+18(a0)
  223.  add.l   d0,gad7           -NOBOOT+26(a0)
  224.  add.l   d0,gad8           -NOBOOT(a0)
  225.  add.l   d0,gad8           -NOBOOT+18(a0)
  226.  add.l   d0,gad8           -NOBOOT+26(a0)
  227.  add.l   d0,gad10          -NOBOOT(a0)
  228.  add.l   d0,gad10          -NOBOOT+18(a0)
  229.  add.l   d0,gad10          -NOBOOT+26(a0)
  230.  add.l   d0,gad11          -NOBOOT(a0)
  231.  add.l   d0,gad11          -NOBOOT+18(a0)
  232.  add.l   d0,gad11          -NOBOOT+26(a0)
  233.  add.l   d0,gad12          -NOBOOT(a0)
  234.  add.l   d0,gad12          -NOBOOT+18(a0)
  235.  add.l   d0,gad12          -NOBOOT+26(a0)
  236.  add.l   d0,gad13          -NOBOOT(a0)
  237.  add.l   d0,gad13          -NOBOOT+18(a0)
  238.  add.l   d0,gad13          -NOBOOT+26(a0)
  239.  add.l   d0,gad14          -NOBOOT(a0)
  240.  add.l   d0,gad14          -NOBOOT+18(a0)
  241.  add.l   d0,gad14          -NOBOOT+26(a0)
  242.  add.l   d0,gad15          -NOBOOT(a0)
  243.  add.l   d0,gad15          -NOBOOT+18(a0)
  244.  add.l   d0,gad15          -NOBOOT+26(a0)
  245.  add.l   d0,gad16          -NOBOOT+18(a0)
  246.  add.l   d0,gad16          -NOBOOT+26(a0)
  247.  add.l   d0,gadborders     -NOBOOT-8(a0)
  248.  add.l   d0,gadborder1     -NOBOOT-8(a0)
  249.  add.l   d0,pairs          -NOBOOT-8(a0)
  250.  add.l   d0,font           -NOBOOT(a0)
  251.  add.l   d0,window         -NOBOOT+26(a0)
  252.  add.l   d0,structtask     -NOBOOT+10(a0)
  253.  add.l   d0,end            -NOBOOT-30(a0)
  254.  add.l   d0,end            -NOBOOT-34(a0)
  255.  add.l   d0,end            -NOBOOT-38(a0)
  256.  lea     reset(pc),a0   ; pc-relative-address-mode is shorter
  257.  move.w  #end-reset-1,d0; dbcc ends if -1 (ffff)
  258. copy:
  259.  move.b  (a0)+,(a1)+    ; copy the real VIRUS-CONTROL-Routine (reset: bis end:)
  260.  dbra    d0,copy        ; to the allocated area
  261.  move.l  pointer(pc),a1
  262.  add.l   #newDOIO-reset,a1
  263.  move.l  a1,-454(a6)    ; set DOIO-vector to VIRUS-CONTROL
  264.  bsr     execchecksum   ; set COOL-vector to VIRUS-CONTROL
  265.  move.l  pointer(pc),a1
  266.  move.l  a1,a2
  267.  add.l   #structtask-reset,a1  ; addtask
  268.  add.l   #task-reset,a2
  269.  sub.l   a3,a3          ; 2 Bytes instead of 6 Bytes(move.l #0,a3)
  270.  jsr     -282(a6)
  271.  move.l  #MeldungEnde-Meldung,textlaenge
  272.  move.l  #Meldung,textaddress
  273.  bsr.s   meldungout
  274.  bra.s   checkdrive     ; check inserted disks
  275. DOIOchanged:
  276.  move.l  #"DOIO",vectorchanged
  277. COOLchanged:
  278.  bsr     freemem
  279.  move.l  #MeldungDangerEnde-MeldungDanger,textlaenge
  280.  move.l  #MeldungDanger,textaddress
  281.  bra.s   meldungout
  282. isinstalled:
  283.  bsr     freemem
  284.  move.l  #MeldungEnde-Meldung,textlaenge
  285.  move.l  #Meldung,textaddress
  286.  move.l  #"  al",Meldungmodify    ; modifying is shorter than
  287.  move.l  #"read",Meldungmodify+4  ; an extra information
  288.  move.l  #"y   ",Meldungmodify+8
  289.  bsr.s   meldungout
  290.  bra.s   checkdrive         ; check inserted disks
  291. meldungout:
  292.  bsr     OpenDOS            ; OpenLibrary("dos.library",0);
  293.  jsr     -60(a6)            ; get outputhandle
  294.  move.l  d0,d1
  295.  movem.l textaddress(pc),d2-d3 ; address + length
  296.  jsr     -48(a6)            ; write
  297.  bra     CloseDOS           ; CloseLibrary("dos.library") + rts
  298.  
  299. checkdrive:                 ; test if -t -c -o -f
  300.  move.l  46(a6),a1
  301.  move.l  a1,VCreset
  302.  move.b  #$ff,openflag-reset(a1)    ; dont change Open() =  default
  303.  move.l  #"OFF ",gadtext15text-reset+14(a1)
  304.  move.w  #$ffff,colorflag-reset(a1) ; colorflag, searchfiles = default
  305.  move.l  #" ON ",gadtext0text-reset+14(a1)
  306.  move.l  #" ON ",gadtext16text-reset+14(a1)
  307.  movem.l Parameter(pc),d0/a0; get -t -c -o -f
  308.  subq.l  #1,d0              ; d0 = Number of additional entered characters
  309.  beq.s   noparameter        ; if only programname -> d0=1, only $0a(Return)
  310. testline:
  311.  cmp.b   #$20,(a0)          ; in a0 address of additional characters
  312.  bne.s   testn              ; ignore spaces
  313.  addq.l  #1,a0
  314.  bra.s   testline
  315. testn:
  316.  cmp.b   #"-",(a0)+
  317.  bne.s   noparameter
  318.  cmp.b   #"c",(a0)          ; -c = insert disk -> no green color
  319.  bne.s   testt
  320.  clr.b   colorflag-reset(a1)
  321.  move.l  #"OFF ",gadtext0text-reset+14(a1)
  322.  addq.l  #1,a0
  323.  bra.s   testline
  324. testt:
  325.  cmp.b   #"t",(a0)          ; -t = do not check inserted disks
  326.  bne.s   testo
  327.  clr.b   checkflag
  328.  addq.l  #1,a0
  329.  bra.s   testline
  330. testo:
  331.  cmp.b   #"o",(a0)          ; -o = set Open() to VIRUS-CONTROL
  332.  bne.s   testf
  333.  clr.b   openflag-reset(a1)
  334.  move.l  #" ON ",gadtext15text-reset+14(a1)
  335.  addq.l  #1,a0
  336.  bra.s   testline
  337. testf:
  338.  cmp.b   #"f",(a0)+         ; -f = do not use S:NoWarning S:VirusName
  339.  bne.s   noparameter
  340.  clr.b   searchfiles-reset(a1)
  341.  move.l  #"OFF ",gadtext16text-reset+14(a1)
  342.  bra.s   testline
  343.  
  344. noparameter:                ; check inserted disks-routine
  345.  moveq   #0,d0              ; df0: (also returncode)
  346.  tst.b   checkflag
  347.  beq     weiter-2
  348.  bsr     OpenDOS
  349.  moveq   #50,d1             ; wait for 1 second for vector-control-Task
  350.  jsr     -198(a6)           ; to set Openflag correctly.
  351.  bsr     CloseDOS
  352.  bsr.s   check
  353.  moveq   #1,d0              ; df1:
  354.  bsr.s   check
  355.  moveq   #2,d0              ; df2:
  356.  bsr.s   check
  357.  moveq   #3,d0              ; df3:
  358.  bra.s   check
  359. check:
  360.  move.l  d0,-(sp)
  361.  sub.l   a1,a1                       ; FindTask()
  362.  jsr     -294(a6)
  363.  move.l  VCreset(pc),a1
  364.  lea     trackport-reset(a1),a1
  365.  move.l  d0,16(a1)
  366.  jsr     -354(a6)                    ; AddPort()
  367.  move.l  VCreset(pc),a1
  368.  lea     trackreq-reset(a1),a1
  369.  lea     trackdisk(pc),a0
  370.  moveq   #0,d1                       ; no flags
  371.  move.l  (sp)+,d0                    ; dfx:
  372.  jsr     -444(a6)                    ; OpenDevice()
  373.  tst.l   d0
  374.  bne.s   OpenDeviceError             ; d0 <> 0 -> dfx: does not exist
  375.  move.l  VCreset(pc),a0
  376.  lea     trackreq-reset(a0),a1
  377.  lea     trackport-reset(a0),a3
  378.  move.l  a3,14(a1)
  379.  lea     blockbuff-reset(a0),a3
  380.  move.l  a3,40(a1)
  381.  moveq   #2,d0
  382.  move.w  d0,28(a1)                   ; CMD_READ
  383.  lsl.l   #8,d0                       ; 512 Bytes from 0 -> VIRUS-CONTROL
  384.  move.l  d0,36(a1)                   ; first checks if disk is inserted,
  385.  clr.l   44(a1)                      ; if not, jump to old DOIO-Routine
  386.  jsr     -456(a6)                    ; DOIO -> jump to VIRUSCONTROL
  387.  ; you have to use VCreset, not 46(a6), because 'remove Virus-Control'
  388.  ; sets 46(a6) = 0
  389.  ; before freemem, vector-control-Task waits for 5 seconds -> enough time
  390.  ; for motor off, CloseDevice() RemPort(), which use this area
  391.  move.l  VCreset(pc),a1
  392.  lea     trackreq-reset(a1),a1
  393.  move.w  #9,28(a1)                   ; motor
  394.  clr.l   36(a1)                      ; off
  395.  jsr     -456(a6)                    ; DOIO
  396.  move.l  VCreset(pc),a1
  397.  lea     trackreq-reset(a1),a1
  398.  jsr     -450(a6)                    ; CloseDevice()
  399. OpenDeviceError:
  400.  move.l  VCreset(pc),a1
  401.  lea     trackport-reset(a1),a1
  402.  jsr     -360(a6)                    ; RemovePort()
  403.  bra     returncode
  404.  
  405. textaddress:  dc.l 0     ; address of information
  406. textlaenge:   dc.l 0     ; length of information
  407. Parameter:    dc.l 0     ; number of additional entered characters
  408. Parameteradr: dc.l 0     ; address of additional entered characters
  409. VCreset:      dc.l 0     ; address of installed VIRUS-CONTROL
  410. checkflag:    dc.b $ff
  411. frei:         dc.b 0
  412. trackdisk:    dc.b "trackdisk.device",0
  413.  even
  414. Meldung:
  415.  dc.b $9b,"33mVIRUS-CONTROL V1.3  by PIUS NIPPGEN "
  416. Meldungmodify: dc.b                       "    now       installed !",10,$9b,"31m"
  417.  dc.b "100% assembler! survives reset! runs on any Amiga! vector-check every second!",10
  418.  dc.b "Kill-Virus  by  vector-restoration!     Bootblock - write - access - control!",10
  419.  dc.b "Reset+left M.button->removes VIRUS-CONTROL!  Reset+right M.button->NoFastMem!",10
  420.  dc.b "insert suspect disk->WarnWindow!   +L-ALT->always WarnWindow!  +R-ALT->never!",10
  421.  dc.b "Bootblock to screen or to File!    Standard, NoFastMem  or File to Bootblock!",10
  422.  dc.b "Bootblockchecksum false->no more (Virus-)Boot,  right->(Virus-)Boot possible!",10
  423.  dc.b "dangerless Boot  from Virus-Disk  because of  Boot-simulation!",10
  424.  dc.b "save Bootblock           to S:NoWarning->only red Warn-Signal!",10
  425.  dc.b "save Bootblock with name to S:VirusName->WarnWindow with name!",10
  426.  dc.b "Protection from Link-Viruses  because of File-protection-mark!",10
  427.  dc.b "-f  do not use  S:NoWarning, S:VirusName!",10
  428.  dc.b "-c  insert disk -> no green color-signal!",10
  429.  dc.b "-t  start -> do not check inserted disks!",10
  430.  dc.b "-o  control   Open(file)   by  requester!",10
  431.  dc.b "contacts    and    comments    welcomed !",10
  432. MeldungEnde: even
  433. MeldungDanger:
  434.  dc.b $9b,"33mVIRUS-CONTROL V1.3 by P.NIPPGEN  not installed,",10,
  435.  dc.b $9b,"31msince "
  436. vectorchanged: ; vectorchanged-address even, because of .l
  437.  dc.b         "COOL-vector already changed ->  by VIRUS?",10
  438.  dc.b "the only  100% safe method  to remove Virus is:",10
  439.  dc.b "AMIGA OFF, Wait, AMIGA ON, start VIRUS-CONTROL!",10
  440. MeldungDangerEnde: even
  441. Meldungvector: dc.b $9b,"33mKICK   -vector changed -> Virus ?",10,$9b,"31m"
  442. MeldungvectorEnde: even
  443. NoWBStart:
  444.  dc.b 0,1,0,0
  445.  dc.w 15,30
  446.  dc.l 0,NoWBStarttext,0
  447. NoWBStarttext:
  448.  dc.b "use CLI, to start VIRUS-CONTROL V1.3 !",0
  449.  even
  450.  
  451. ; do not address absolutely in the real VIRUS-CONTROL-Routine (reset: - end:),
  452. ; since this routine is copied to the new, allocated area, therefore there
  453. ; are new absolute addresses, you have to address relatively:
  454. ; move address(pc),lea(pc),bsr,bra  instead of move address,lea,jsr,jmp
  455. reset:                 ; if reset->if execchecksum correct->cool-vector
  456.  btst    #6,$bfe001    ; cool-vector points to reset:
  457.  bne.s   weiter        ; if left mouse-button is pressed during reset ->
  458.  clr.l   $2e(a6)       ; remove VIRUS-CONTROL.
  459.  rts
  460. weiter:
  461.  movem.l d0-d7/a0-a6,-(sp);
  462.  move.l  pointer(pc),a1
  463.  move.l  #end-reset+9000,d0
  464.  jsr     -204(a6)      ; AllocAbs -> allocate the VIRUS-CONTROL-routine
  465.  tst.l   d0
  466.  bne.s   AllocAbsOkay  ; in COOL-Routine you cannot use Libraries, except
  467. showend:               ; Exec-Library. expansion-ram is not recognized yet.
  468.  bsr     optzeichen    ; Therfore use Chip-memory
  469.  bra.s   showend
  470. AllocAbsOkay:          ; AllocAbs does not fail, since nothing is allocated
  471.  lea     taskflag(pc),a0  ; clear taskflag, resetflag, exitflag, exitcount
  472.  clr.l   (a0)+            ; clear inuse-flags
  473.  clr.l   (a0)             ; clear taskflag, exitcount, inuse-flags satisfies
  474.  bsr     VCrestore        ; set vectors to VIRUS-CONTROL
  475.  bsr     optzeichen       ; green color-signal -> VIRUS-CONTROL still active
  476.  movem.l (sp)+,d0-d7/a0-a6; reset does not change coolvector, execchecksum
  477.  rts
  478.  
  479. newDOIO:                ; new entry for DOIO-Routine.
  480.  cmp.l   #$400,36(a1)   ; 1024 Bytes - reset
  481.  beq.s   test
  482.  cmp.l   #$200,36(a1)   ; 512 Bytes  - insert Disk, loadwb
  483.  beq.s   test           ; keep code short, which is passed by every DOIO,
  484.  bra     jmpoldDOIO     ; to avoid deadlock
  485. ; Code has to be reentrant, because code can be used simultaneously
  486. ; for df0:-Df3:. Therfore you cannot use an absolute address to store
  487. ; for instance gadgetID or windowpointer, because each task will use this
  488. ; only address -> crash. Use unused registers to store. If Task-change,
  489. ; these registers are automatically changed too.
  490. ; d6 = dfx: to modify requester-text  d7 = Windowpointer, a5 = bootblockbuffer
  491. ; d4 = IDCMPclass, d5 LowWord=gadgetID, d5 HiWord= 1Unterschied ausgeben
  492. ; the library-functions change d0,d1,(d2,d3),a0,a1 at least. Therfore save
  493. ; registers, before using a library-function.
  494. ; To keep VIRUS-CONTROL short, text is modified for dfx: before output.
  495. ; first forbid(), then modifying, then output, then permit().
  496. ; if not -> for instance a task modifies text, taskswitch to another task,
  497. ; this task also modifies this text, then correct output, taskswitch to old
  498. ; task, and now output of meanwhile incorrect text.
  499. ; Modifying of data is not very elegant, but if saves a lot of data.
  500. ; Without modifying you need 4*more data-structures ( df0: -df3: )
  501. test:
  502.  movem.l d0-d7/a0-a6,-(sp);
  503.  move.l  $4.w,a6        ; a6 only mostly = exec-base,  DOIO(a5) works
  504.  move.l  20(a1),a0      ; a1 pointer to I/O-request-structure
  505.  move.l  10(a0),a0      ; in 20(a1) address of Device-structure, which starts
  506.  cmp.l   #"trac",(a0)+  ; with a Node-structure, test name
  507.  bne.s   shorter4       ; DOIO-access to Trackdisk.device ?
  508.  cmp.l   #"kdis",(a0)+
  509.  bne.s   shorter4
  510.  cmp.l   #"k.de",(a0)
  511.  bne.s   shorter4
  512.  tst.l   44(a1)         ; from Block 0 ?
  513.  bne.s   shorter4
  514.  cmp.w   #$02,28(a1)    ; reading ?
  515.  beq.s   read3
  516.  cmp.w   #$03,28(a1)    ; writing ? -> requester in bootblockread
  517. shorter4:               ; bne.s shorter4 = 2 byte, bne.l DOIOweiter = 4 byte
  518.  bne     DOIOweiter1
  519. read3:
  520.  move.l  24(a1),a0      ; OpenDevice() enters address of dfx:-MsgPort
  521.  move.b  67(a0),d0      ; in IO_UNIT
  522.  move.b  d0,d6          ; d6 = dfx:
  523.  btst    #1,64(a0)      ; dfx: no disk inserted -> jmp oldDOIO
  524.  bne     shorter4
  525.  lea     inuse0(pc),a0
  526.  ext.w   d6             ; d6(byte)-> Word-> Longword, because of add.l
  527.  ext.l   d6
  528.  add.l   d6,a0
  529.  tst.b   (a0)           ; test dfx:-inuse-Flag
  530.  bne     shorter4       ; if aleady dfx:-WarnWindow jmp oldDOIO
  531.  move.b  #$ff,(a0)      ; set inuse-flag
  532.  lea     exitcount(pc),a0 ; exitcount +1, if work on disk
  533.  addq.b  #1,(a0)
  534.  moveq   #0,d5          ; if -f, do not print intuitext
  535.  bsr     bootblockread  ; read bootblock (tests write-access)
  536.  bsr     nameunknown    ; clear last virusname
  537.  cmp.l   #$400,36(a1)   ; reset->1024->set reset-flag->ignore first 512-DOIO
  538.  beq.s   checkiton
  539.  lea     resetflag(pc),a0
  540.  move.b  (a0),d0        ; ignore first DOIO() 512 Bytes from 0,
  541.  clr.b   (a0)           ; because most dos.library-functions cannot be
  542.  tst.b   d0             ; used yet. for instance Open() -> Task-Held
  543.  bne     DOIOweiter
  544.  cmp.b   #$35,$bfec01   ; right Alt-key pressed ?
  545.  beq     DOIOweiter     ; R-ALT -> no VIRUS-CONTROL-Test
  546.  lea     colorflag(pc),a0
  547.  tst.b   (a0)
  548.  beq.s   nocolor        ; colorflag = 0 -> no green color-signal
  549.  bsr     optzeichen
  550. nocolor:
  551.  cmp.b   #$37,$bfec01   ; left Alt-key pressed ?
  552.  beq     VirusNameFile  ; L-ALT -> always Warn-Window
  553. checkiton:
  554.  move.l  a5,a0          ; bootblockread puts bufferaddress into a5
  555.  cmp.l   #$444f5300,(a0); "DOS",0 ?
  556.  bne     DOIOweiter     ; no DOS-Disk
  557.  bsr     bootchecksum   ; Bootblockchecksum false -> no danger, no boot
  558.  bne     DOIOweiter
  559.  ; it is a DOS-disk + CHECKSUM okay -> disk-Bootroutine will be used,
  560.  ; therefore test if VIRUS-code.
  561.  move.l  a5,a0
  562.  add.l   #12,a0
  563.  cmp.l   #$43fa0018,(a0)+ ; (a0)+ shorter than for instance 12(a0)
  564.  bne.s   testreset      ;
  565.  cmp.l   #$4eaeffa0,(a0)+ ; is it harmless standard-boot-code ?
  566.  bne.s   testreset
  567.  cmp.l   #$4a80670a,(a0)+
  568.  bne.s   testreset
  569.  cmp.l   #$20402068,(a0)+
  570.  bne.s   testreset
  571.  cmp.l   #$00167000,(a0)+
  572.  bne.s   testreset
  573.  cmp.l   #$4e7570ff,(a0)+
  574.  bne.s   testreset
  575.  cmp.l   #$60fa646f,(a0)
  576. testreset:
  577.  jsr     -528(a6)        ; getcc() -> 68010,20 compatible
  578.  move.w  d0,-(sp)        ; save flags, beq=no virus  bne=virus
  579.  cmp.l   #$400,36(a1)    ; 1024 Bytes=reset. insert Disk + loadwb = 512
  580.  bne     nobootroutine
  581.  move.l  62(sp),a0       ; test RTS-address, if ROM-call-DOIO.
  582.  cmp.l   #$00fc0000,a0   ; in ROM only 1*DOIO with $400 -> in boot-routine.
  583.  blo     nobootroutine   ; a program could jmp DOIO with an ROM-address
  584.  cmp.w   #$4a80,(a0)     ; on stack by accident, therfore make sure, if it
  585.  bne     nobootroutine   ; is reset-boot-routine really, by comparing code.
  586.  cmp.l   #$2014b0ba,4(a0); Do not use a direct ROM-address, because this would
  587.  bne     nobootroutine   ; not work with future ROM-versions.
  588.  ; here in boot-routine you can use all libraries, except dos.library,
  589.  ; because dos.library is prepared by bootblock-code.
  590.  ; since 'system-configuration' is not read yet, Standard-Font is Topaz 9 ->
  591.  ; 60 characters in a line.
  592.  lea     resetflag(pc),a3
  593.  move.b  #$ff,(a3)      ; set resetflag -> ignore 1*512-Bytes-DOIO
  594.  cmp.w   #$100,$dff016  ; right mouse-button pressed ?
  595.  bne.s   memokay
  596. fastaway:
  597.  move.l  #$20004,d1     ; get largest-Fastmem-area
  598.  movem.l d1-d7/a0-a6,-(sp)
  599.  jsr     -216(a6)       ; availmem()
  600.  movem.l (sp)+,d1-d7/a0-a6
  601.  tst.l   d0
  602.  beq.s   memokay
  603.  movem.l d1-d7/a0-a6,-(sp)
  604.  jsr     -198(a6)       ; allocate this area
  605.  movem.l (sp)+,d1-d7/a0-a6
  606.  tst.l   d0
  607.  bne.s   fastaway
  608. memokay:
  609.  move.w  (sp)+,ccr
  610.  beq.s   bootsimul      ; faster than read again
  611.  movem.l a0-a3,-(sp)    ; save a0, because of modifyunit, save a1,a2,a3
  612.  jsr     -132(a6)       ; because of Requester-parameter
  613.  bsr     modifyunit
  614.  lea     NOBOOTtext(pc),a0
  615.  clr.b   26(a0)         ; shorten 'String'
  616.  lea     BOOT(pc) ,a1
  617.  lea     BOOTL(pc),a2
  618.  lea     BOOTR(pc),a3
  619.  bsr     autorequest
  620.  move.b  #" ",26(a0)    ; restore 'String', will be used in Warn-Window
  621.  jsr     -138(a6)
  622.  movem.l (sp)+,a0-a3    ; true  1  retry  = left  Gadget
  623.  tst.l   d0             ; false 0  cancel = right Gadget
  624.  beq.s   bootsimul      ; left -> Boot-simulation
  625.  movem.l a0-a3,-(sp)
  626.  jsr     -132(a6)
  627.  bsr     modifyunit
  628.  lea     REALLYBOOT(pc),a1
  629.  lea     BOOTL(pc),a2
  630.  lea     BOOTR(pc),a3   ; really Original-Disk-Boot-Routine ?
  631.  bsr     autorequest    ; Danger -> can activate viruses !
  632.  jsr     -138(a6)
  633.  movem.l (sp)+,a0-a3
  634.  tst.l   d0
  635.  beq.s   bootsimul
  636.  movem.l d0-d7/a0-a6,-(sp); in boot-routine dos.library cannot be used yet,
  637.  bsr     settimer         ; you have to use timer.device directly instead of
  638.  bsr     wait1            ; Delay(). wait for 2 sec., in this time, Screen,
  639.  bsr     wait1            ; Window-lists can be updated .....This waiting is
  640.  bsr     remreqport       ; needed only for a few dirty programmed BootIntros.
  641.  bsr     addtask
  642.  movem.l (sp)+,d0-d7/a0-a6
  643.  bra     DOIOweiter ; read and execute original-bootcode->could activate Virus!
  644.  
  645. bootsimul:
  646.  bsr     addtask
  647.  move.l  40(a1),a0
  648.  move.l  a0,a2
  649.  bsr     clear1024
  650.  lea     bootblock(pc),a0
  651.  moveq   #bootblockend-bootblock-1,d0
  652. loop6:
  653.  move.b  (a0)+,(a2)+
  654.  dbra    d0,loop6
  655.  bsr     clearflags
  656.  movem.l (sp)+,d0-d7/a0-a6
  657.  moveq   #$0,d0 ; rts to ROM with d0=0 -> DOIO okay
  658.  rts     ; instead of jmp oldDOIO (reads original-bootcode in buffer),
  659.          ; copy harmless bootcode in buffer, rts to ROM (execute code)
  660. nobootroutine:
  661.  move.w  (sp)+,ccr
  662.  beq     DOIOweiter        ; no Virus
  663.  lea     searchfiles(pc),a0
  664.  tst.b   (a0)              ; do not search S:NoWarning, S:VirusName,
  665.  beq     openwindow        ; if searchfiles = 0
  666.  ; if Bootblock is saved in S:NoWarning-File -> only red signal
  667.  movem.l d0-d7/a0-a6,-(sp)
  668.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  669.  lea     NoWarning(pc),a0
  670.  move.l  a0,d1             ; Filename
  671.  move.l  #1004,d2          ; MODE_READWRITE, to open existing S:NoWarning-File
  672.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  673.  tst.l   d0                ; wrong data.
  674.  beq     NoWarnError
  675.  movem.l d1-d7/a0-a6,-(sp)
  676.  jsr     -30(a6)
  677.  movem.l (sp)+,d1-d7/a0-a6 ; OpenError, for instance if not existing
  678.  tst.l   d0                ; or EXCLUSIVE_LOCK by other process.
  679.  beq     NoWarnError
  680.  move.l  d0,d1             ; filehandle
  681. nextbootblock:
  682.  move.l  a5,a2
  683.  lea     Nobuff(pc),a0
  684.  move.l  a0,d2             ; use vector-control-Task-Stack-bottom
  685.  move.l  #1024,d3          ; as 1024-buffer
  686.  movem.l d1-d7/a0-a6,-(sp)
  687.  jsr     -42(a6)           ; read first Bootblock from S:NoWarning
  688.  movem.l (sp)+,d1-d7/a0-a6
  689.  cmp.l   #1024,d0          ; no more Bootblock -> end of file
  690.  bne.s   fileende
  691.  move.w  #$ff,d0
  692. NoWarningloop:
  693.  cmpm.l  (a0)+,(a2)+
  694.  bne.s   nextbootblock
  695.  dbra    d0,NoWarningloop
  696.  bsr     CloseFile         ; 1024 Bytes identical -> found !
  697.  move.l  #$0f000f00,d0     ; found -> red signal
  698.  bsr     optzeichen2
  699.  movem.l (sp)+,d0-d7/a0-a6
  700.  bra     DOIOweiter
  701. fileende:                  ; not found !
  702.  bsr     CloseFile         ; Close File + Close dos.library
  703.  bra.s   allclosed
  704. NoWarnError:
  705.  bsr     CloseDOS          ; Close dos.library
  706. allclosed:
  707.  movem.l (sp)+,d0-d7/a0-a6
  708.  
  709. VirusNameFile:
  710.  ; before opening Warn-Window, test, if Bootblock saved in VirusName-File,
  711.  ; if found -> use this name
  712.  lea     searchfiles(pc),a0
  713.  tst.b   (a0)              ; if -f ignore S:VirusName, even if L-ALT pressed
  714.  beq     openwindow
  715.  movem.l d0-d7/a0-a6,-(sp)
  716.  bsr     nameunknown       ; default
  717.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  718.  lea     VirusName(pc),a0
  719.  move.l  a0,d1             ; Filename-address
  720.  move.l  #1004,d2          ; MODE_READWRITE, to open existing S:NoWarning-File
  721.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  722.  tst.l   d0                ; wrong data.
  723.  beq     OpenFailed
  724.  movem.l d1-d7/a0-a6,-(sp)
  725.  jsr     -30(a6)
  726.  movem.l (sp)+,d1-d7/a0-a6
  727.  tst.l   d0                ; OpenError, for instance if not existing
  728.  beq     OpenFailed        ; or EXCLUSIVE_LOCK by other process.
  729.  move.l  d0,d1             ; filehandle
  730. nextbootblock1:
  731.  clr.b   20(sp)               ; movem -> 20(sp)=d5, (GadgetID now not used)
  732.  lea     Vibuff(pc),a0
  733.  move.l  a0,d2                ; use vector-control-Task-Stack-bottom
  734.  move.l  #1024+buff1-buff0,d3 ; as 1024+32-buffer
  735.  movem.l d1-d7/a0-a6,-(sp)
  736.  jsr     -42(a6)              ; read 1 Virusname+Bootblock from S:VirusName
  737.  movem.l (sp)+,d1-d7/a0-a6
  738.  cmp.l   #1024+buff1-buff0,d0
  739.  bne.s   fileende1            ; end of file
  740.  lea     NAME0text(pc),a2
  741.  moveq   #buff1-buff0+20,d0   ; copy Virusname into corresponding Intuitext-
  742.  mulu    d6,d0                ; structure, will be printeted in Warn-Window
  743.  add.l   d0,a2
  744.  bsr     copyname
  745.  move.w  #$ff,d0
  746.  move.l  a5,a2
  747. VirusNameloop:
  748.  cmpm.l  (a0)+,(a2)+
  749.  beq.s   issame
  750.  cmp.l   #"FREE",-4(a0)
  751.  beq.s   nextbootblock1
  752.  tst.b   20(sp)
  753.  bne.s   nextbootblock1
  754. countit:                   ; accept 1 Longword-difference (infection-counter)
  755.  move.b  #$ff,20(sp)       ; 1 Longword-difference-flag
  756. issame:
  757.  dbra    d0,VirusNameloop  ; 1024 Bytes identical -> found !
  758.  bra.s   CloseFileDOS
  759. fileende1:                 ; not found !
  760.  bsr     nameunknown
  761. CloseFileDOS:
  762.  bsr     CloseFile         ; Close File + Close dos.library
  763.  bra.s   allclosed1
  764. OpenFailed:
  765.  bsr     CloseDOS          ; Close dos.library
  766. allclosed1:
  767.  movem.l (sp)+,d0-d7/a0-a6
  768.  bra     openwindow
  769.  
  770. Checksumfalsch:
  771.  move.l  24(a1),a0      ; write false Bootblock-Checksum -> inactivates
  772.  btst    #4,64(a0)      ; Bootblock-Virus, because of no more Boot.
  773.  ; first check write-protection. OpenDevice() entered address of dfx:-MsgPort
  774.  ; in IO_UNIT. MsgPort byte 64: if Bit 4 is set -> Disk is write-protected.
  775.  beq.s   noprotect
  776.  bsr.s   writeprotected ; write-protected -> Requester
  777.  bne.s   Checksumfalsch ; retry
  778.  rts
  779. noprotect:
  780.  bsr     setchecksum    ; get correct Bootblockchecksum
  781.  addq.l  #1,4(a0)       ; -> no more correct
  782. writecheck:
  783.  bra     bootblockwrite ; write incorrect checksum -> no more boot
  784.  
  785. Checksumrichtig:
  786.  move.l  24(a1),a0
  787.  btst    #4,64(a0)
  788.  beq.s   noprotect1
  789.  bsr.s   writeprotected
  790.  bne.s   Checksumrichtig
  791.  rts
  792. noprotect1:
  793.  bsr     setchecksum    ; get correct Bootblockchecksum
  794.  bra.s   writecheck
  795.  
  796. writeprotected:         ; write-protected-requester
  797.  movem.l a0-a3,-(sp)
  798.  jsr     -132(a6)
  799.  bsr     modifyunit
  800.  lea     PROTECT(pc) ,a1
  801.  lea     PROTECTL(pc),a2
  802.  lea     NOBOOTR(pc) ,a3
  803.  bra     shorter2
  804.  
  805. showbootblock:             ; if a4(=Filename) = RAW: -> Bootblock-ASCII-Dump
  806.  movem.l d0-d7/a0-a6,-(sp) ; else save to file
  807.  jsr     -132(a6)
  808.  bsr     modifyunit
  809.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  810.  move.l  a4,d1             ; showbootblock is called with a4=filename
  811.  move.l  #1006,d2          ; newmode
  812.  bsr     checkdevicename
  813.  tst.l   d0
  814.  bne.s   deviceokay
  815.  movem.l d1-d7/a0-a6,-(sp)
  816.  bra.s   deviceunknown
  817. deviceokay:
  818.  movem.l d1-d7/a0-a6,-(sp)
  819.  jsr     -30(a6)           ; Open() (if RAW:-Window -> modified title-line)
  820. deviceunknown:
  821.  move.l  $4.w,a6
  822.  jsr     -138(a6)
  823.  movem.l (sp)+,d1-d7/a0-a6 ; DOIO->writeprotect->own requester
  824.  tst.l   d0                ; DOSfunctions->writeprotect->AmigaDOSAutorequester
  825.  bne.s   NoErrorShow       ; OpenError(wrong filename)->own requester
  826.  bsr     openerror
  827.  bra     OpenFailed
  828. NoErrorShow:
  829.  move.l  d0,d1             ; filehandle
  830.  bsr     WriteInFile
  831.  cmp.l   #"RAW:",(a4)
  832.  bne     CloseFileDOS
  833.  lea     unit2(pc),a0      ; you can use unit2 as read-buffer, because
  834.  move.l  a0,d2             ; it will be restored
  835.  moveq   #1,d3             ; get 1 character
  836.  movem.l d0-d7/a0-a6,-(sp)
  837.  jsr     -42(a6)           ; Read  RAW:  waits for key
  838.  movem.l (sp)+,d0-d7/a0-a6
  839.  bsr     CloseFile
  840.  movem.l (sp)+,d0-d7/a0-a6; restore a1-IORequest
  841.  bsr     bootblockread    ; because ASCII-dump changed Bootblock-data
  842.  bra     openwindow
  843.  
  844. autorequest:              ; call with a6=exec.base
  845.  movem.l d1-d7/a0-a6,-(sp)
  846.  movem.l a1-a3,-(sp)      ; maintext, left text, right text
  847.  bsr     OpenIntuition
  848.  jsr     -342(a6)         ; WBenchToFront() -> like an AmigaDOS-Autorequester
  849.  sub.l   a0,a0            ; 2 Bytes, move.l #0,a3 needs 6 Bytes
  850.  movem.l (sp)+,a1-a3      ; maintext, left text, right text
  851.  moveq   #0,d0            ; no IDCMP-Flags for left Gadget
  852.  moveq   #0,d1            ; no IDCMP-Flags for right Gadget
  853.  move.l  #640,d2          ; Autorequester-width
  854.  moveq   #100,d3          ; Autorequester-height
  855.  jsr     -348(a6)         ; AutoRequest()
  856.  move.l  a6,a1            ; intuitionbase
  857.  move.l  $4.w,a6
  858.  move.l  d0,-(sp)         ; save BOOL
  859.  jsr     -414(a6)         ; CloseLibrary("intuition.library");
  860.  move.l  (sp)+,d0         ; BOOL
  861.  movem.l (sp)+,d1-d7/a0-a6; movem does not overwrite d0
  862.  rts
  863.  
  864. optzeichen:
  865.  move.l  #$00f000f0,d0 ; green green -> VirusControl okay
  866. optZeichen2:           ; color in d0
  867.  movem.l d0-d7/a0-a6,-(sp)
  868.  move.l  $4.w,a6       ; Disable() -> color-registers are permanently set
  869.  jsr     -120(a6)      ; -> Copperlist has no effect
  870.  move.w  #40,d1        ; use vertical beam-position as 'Timer'
  871. red:                   ; -> can be used in cool-routine already and same delay
  872.  move.b  $dff005,d2    ; for any processors
  873. waittick:
  874.  move.l  d0,$dff180
  875.  move.l  d0,$dff184    ; overwrite 4 Workbench-colors
  876.  cmp.b   $dff005,d2
  877.  beq.s   waittick
  878.  dbra    d1,red
  879.  jsr     -126(a6)      ; Enable()
  880.  movem.l (sp)+,d0-d7/a0-a6
  881.  rts
  882.                        ; a6=exec.base, a1=IO-Request
  883. bootblockread:         ; changes a0,d0, a5
  884.  moveq   #0,d0         ; if write-access -> requester
  885. bb:
  886.  move.l  36(a1),-(sp)  ; save original-number of bytes
  887.  move.l  40(a1),-(sp)  ; save original-buffer
  888.  tst.l   d0
  889.  bne.s   readaccess    ; do write-access without requester
  890.  cmp.w   #$02,28(a1)   ; read-access ?
  891.  beq.s   readaccess
  892.  bsr     writebbzugriff
  893.  bne.s   changetoread
  894.  add.l   #12,sp        ; correct Stack
  895.  bra     DOIOweiter    ; write-access -> oldDOIO-routine
  896. changetoread:
  897.  move.w  #$02,28(a1)   ; change to harmless read-access
  898. readaccess:
  899.  lea     bootblock0(pc),a0
  900.  move.l  #bootblock1-bootblock0,d0
  901.  mulu    d6,d0
  902.  add.l   d0,a0
  903.  move.l  a0,a5         ; a5 = bootblockbuffer for dfx:
  904.  move.l  a0,40(a1)
  905.  move.l  #1024,36(a1)  ; 1024 -> read total Bootblock
  906.  movem.l d1-d7/a0-a6,-(sp)
  907.  bsr     jmpoldDOIO
  908.  movem.l (sp)+,d1-d7/a0-a6
  909.  tst.l   d0
  910.  beq.s   bootblockreadokay
  911.  bsr     openerror
  912. bootblockreadokay:
  913.  move.l  (sp)+,40(a1)  ; restore original-buffer
  914.  move.l  (sp)+,36(a1)  ; restore original-number of bytes
  915.  rts
  916.  
  917. bootblockwrite:        ; a6=exec.base, a1=IO-Request
  918.  move.l  24(a1),a0     ; changes a0,d0, a5
  919.  btst    #4,64(a0)
  920.  beq.s   noprotect3
  921.  bsr     writeprotected; if Disk writeprotected or removed
  922.  bne.s   bootblockwrite
  923.  rts
  924. noprotect3:
  925.  moveq   #-1,d0        ; write without requester
  926.  move.w  #3,28(a1)     ; 3 = CMD_WRITE
  927.  bsr     bb
  928.  move.w  #2,28(a1)     ; 2 = CMD_READ
  929.  rts
  930. ; Before writing to disk by DOIO, you have to check if write-protected.
  931. ; If you write to disk by dos.library-functions, then there are AmigaDos-
  932. ; autorequesters automatically.
  933.  
  934. bootchecksum:          ; a0=address of bootblockbuffer
  935.  move.w  #$ff,d1       ; changes a0, d0,d1
  936.  moveq   #$0,d0        ; rts with d0=bootblockchecksum
  937. loop:
  938.  add.l   (a0)+,d0
  939.  bcc.s   jump
  940.  addq.l  #1,d0
  941. jump:
  942.  dbra d1,loop
  943.  not.l   d0
  944.  rts
  945.  
  946. setchecksum:
  947.  move.l  a5,a0
  948.  clr.l   4(a0)         ; clear old Bootblockchecksum
  949.  bsr.s   bootchecksum  ; calc new, correct Bootblockchecksum
  950.  move.l  a5,a0
  951.  move.l  d0,4(a0)      ; set correct Bootblockchecksum
  952.  rts
  953.  
  954. WriteInFile:           ; changes a0, d0,d1,d2,d3
  955.  move.l  a5,d2         ; d2 = address of write-buffer
  956.  move.l  #1024,d3      ; d3 = number of write-bytes
  957.  move.w  #1023,d0      ; 1024-1 counter for dbra
  958.  move.l  d2,a0
  959. modifybuffer:
  960.  cmp.l   #"RAW:",(a4)  ; if filename starts with "RAW:" -> prepare data
  961.  bne.s   writeokay     ; for ASCII-dump
  962.  cmp.b   #$20,(a0)
  963.  blo.s   writedefault
  964.  cmp.b   #127,(a0)
  965.  blo.s   writeokay
  966. writedefault:          ; if byte < 32  or byte > 126 -> show  .
  967.  move.b  #".",(a0)
  968. writeokay:
  969.  addq.l  #1,a0
  970.  dbra    d0,modifybuffer
  971.  movem.l d0-d7/a0-a6,-(sp)
  972.  jsr     -48(a6)       ; Write
  973.  movem.l (sp)+,d0-d7/a0-a6
  974.  rts
  975.  
  976. modifyunit:            ; modifies output-text for dfx:
  977.  move.b  d6,d0         ; d6=dfx:
  978.  add.b   #48,d0
  979.  lea     unit0(pc),a0
  980.  move.b  d0,(a0)
  981.  lea     unit1(pc),a0
  982.  move.b  d0,(a0)
  983.  lea     unit2(pc),a0
  984.  move.b  d0,(a0)
  985.  lea     unit3(pc),a0
  986.  move.b  d0,(a0)
  987.  lea     unit4(pc),a0
  988.  move.b  d0,(a0)
  989.  lea     unit5(pc),a0
  990.  move.b  d0,(a0)
  991.  lea     unit6(pc),a0
  992.  move.b  d0,(a0)
  993.  lea     unit7(pc),a0
  994.  move.b  d0,(a0)
  995.  lea     unit8(pc),a0
  996.  move.b  d0,(a0)
  997.  rts
  998.  
  999. DOIOweiter:
  1000.  bsr     clearflags
  1001. DOIOweiter1:
  1002.  movem.l (sp)+,d0-d7/a0-a6
  1003. jmpoldDOIO: dc.w $4ef9 ; Opcode for jmp
  1004. oldDOIO:    dc.l 0     ; address of Original-DOIO-Routine
  1005.  
  1006. bootblock:             ; harmless Original-Bootblock for Boot-Simulation
  1007.  dc.b    "DOS",0       ; if you change Bootblock, you have to correct
  1008.  dc.l    $c0200f19     ; Bootblock-Checksum
  1009.  dc.l    $00000370
  1010.  lea     dosname(pc),a1
  1011.  jsr     -96(a6)
  1012.  tst.l   d0
  1013.  beq.s   error
  1014.  move.l  d0,a0
  1015.  move.l  22(a0),a0
  1016. returncode:
  1017.  moveq   #0,d0
  1018. ende0:
  1019.  rts
  1020. error:
  1021.  moveq   #-1,d0
  1022.  bra.s ende0
  1023. dosname: dc.b "dos.library",0
  1024. bootblockend: even
  1025.  
  1026. nofastbootblock:       ; NoFastMem-Bootblock
  1027.  dc.b    "DOS",0
  1028.  dc.l    $aadce5ec
  1029.  dc.l    $00000370
  1030.  movem.l d0-d7/a0-a6,-(sp)
  1031.  btst    #6,$bfe001
  1032.  beq.s   memokay1      ; if you press left mouse-button during reset
  1033. fastaway1:             ; -> no NoFastMem
  1034.  move.l  #$20004,d1
  1035.  movem.l d1-d7/a0-a6,-(sp)
  1036.  jsr     -216(a6)      ; availmem()
  1037.  movem.l (sp)+,d1-d7/a0-a6
  1038.  tst.l   d0
  1039.  beq.s   optzeichen1
  1040.  movem.l d1-d7/a0-a6,-(sp)
  1041.  jsr     -198(a6)      ; allocmem()
  1042.  movem.l (sp)+,d1-d7/a0-a6
  1043.  tst.l   d0
  1044.  bne.s   fastaway1
  1045. optZeichen1:           ; NoFastMem -> blue color-signal
  1046.  jsr     -132(a6)      ; Forbid() -> color-registers are permanently set
  1047.  move.l  #$000f000f,d0 ; -> Copperlist has no effect
  1048.  move.w  #40,d1
  1049. farbe:
  1050.  move.b  $dff005,d2
  1051. waittick1:
  1052.  move.l  d0,$dff180
  1053.  move.l  d0,$dff184    ; overwrite 4 Workbench-colors
  1054.  cmp.b   $dff005,d2
  1055.  beq.s   waittick1
  1056.  dbra    d1,farbe
  1057.  jsr     -138(a6)      ; Permit()
  1058. memokay1:
  1059.  movem.l (sp)+,d0-d7/a0-a6
  1060.  lea     dosname1(pc),a1; now the real Standard-Bootblock
  1061.  jsr     -96(a6)
  1062.  tst.l   d0
  1063.  beq.s   error1
  1064.  move.l  d0,a0
  1065.  move.l  22(a0),a0
  1066.  moveq   #0,d0
  1067. ende1:
  1068.  rts
  1069. error1:
  1070.  moveq   #-1,d0
  1071.  bra.s   ende1
  1072. dosname1:dc.b "dos.library",0
  1073.  even
  1074. taskname:dc.b " VIRUS-CONTROL V1.3 by PIUS NIPPGEN, D-6657 Gersheim 8,"
  1075.          dc.b " 06843/1522",0
  1076. ; operating instructions
  1077. dc.b "automatically switching off FASTMEM can be prevented by pressing "
  1078. dc.b "left mouse-button during reset"
  1079. nofastbootblockend: even
  1080.  
  1081. openfile:
  1082.  cmp.b   #$39,$bfec01   ; CTRL-Taste ?
  1083.  beq.s   jmpoldopen     ; -> Original-Open()
  1084.  movem.l a0-a1,-(sp)
  1085.  move.l  d1,a0
  1086.  cmp.b   #"*",(a0)      ; ignore Open("*")
  1087.  movem.l (sp)+,a0-a1
  1088.  beq.s   jmpoldopen
  1089.  movem.l d1-d7/a0-a6,-(sp)
  1090.  moveq   #-2,d2         ; ACCESS_READ
  1091.  move.l  dosbase(pc),a6 ; because a5=dos.base works too
  1092.  jsr     -84(a6)        ; Lock() ( RAW:Window->for a short time RAW:Window)
  1093.  movem.l (sp)+,d1-d7/a0-a6
  1094.  tst.l   d0
  1095.  beq.s   jmpoldopen     ; file not existing -> no danger
  1096.  movem.l d1-d7/a0-a6,-(sp)
  1097.  move.l  d0,d1
  1098.  move.l  dosbase(pc),a6 ; because a5=dos.base works too
  1099.  jsr     -90(a6)        ; Unlock()
  1100.  movem.l (sp)+,d1-d7/a0-a6
  1101.  movem.l d1-d7/a0-a6,-(sp)
  1102.  lea     opencount(pc),a0
  1103.  addq.b  #1,(a0)
  1104.  bsr     allowaccess    ; wait for mouse-click
  1105.  subq.b  #1,(a0)        ; VIRUS-CONTROL can be finished, if opencount=0
  1106.  movem.l (sp)+,d1-d7/a0-a6
  1107.  tst.l   d0
  1108.  bne.s   jmpoldopen
  1109.  bra     returncode
  1110.  
  1111. jmpoldopen: dc.w 0     ; will be copied 'moveq #$ff,d1'
  1112. jmp:        dc.w $4ef9 ; Opcode for jmp
  1113. oldopen:    dc.l 0     ; address of Original-Open-Routine
  1114. savebra:    dc.l 0     ; save Original bra offset
  1115.  
  1116. ; SYSTEM-VECTOR-CONTROL-TASK.
  1117. ; dos.library-functions can be used by processes only.
  1118. ; Therefore use timer.device for waiting, instead of Delay()
  1119. task:
  1120.  move.l  $4.w,a6
  1121.  bsr     settimer          ; prepare timer.device
  1122.  lea     taskflag(pc),a0   ; if CLI-Start do not wait
  1123.  tst.b   (a0)              ; after Reset wait for a few seconds until
  1124.  bne.s   ttt               ; WorkBenchScreen is open. If you do not wait
  1125.  move.l  #10,32(a1)        ; for WorkBenchScreen -> a StandardScreen is
  1126.  bsr     wait              ; opened, if there is an autorequester for a
  1127. ttt:                       ; changed vector. Because of this StandardScreen
  1128.  bsr     opendos           ; 'system-configuration' will not be used completely
  1129.  lea     dosbase(pc),a0    ; for instance width>640, Interlace is ignored.
  1130.  move.l  d0,(a0)           ; also there has to be waiting, because dos.library
  1131. taskweiter:                ; has to be installed (boot-code) before calling
  1132.  lea     openflag(pc),a0   ; opendos
  1133.  tst.b   (a0)              ; openflag can be set by -o  or Window-Gadget
  1134.  bne.s   tt
  1135.  move.l  dosbase(pc),a6    ;
  1136.  cmp.w   #$4ef9,-30(a6)
  1137.  beq.s   tt                ; already set to VIRUS-CONTROL
  1138.  lea     jmpoldopen(pc),a0
  1139.  move.w  -30(a6),(a0)      ; moveq #$ff,d1
  1140.  lea     -26(a6),a4        ; turn relative address to
  1141.  add.w   -26(a6),a4        ; absolute address
  1142.  move.l  a4,4(a0)
  1143.  move.l  -28(a6),8(a0)
  1144.  move.l  $4.w,a4
  1145.  exg     a4,a6
  1146.  jsr     -120(a6)          ; Disable(), because theoretically task-switch
  1147.  exg     a4,a6             ; after 1 instruction
  1148.  lea     openfile(pc),a0
  1149.  move.w  #$4ef9,-30(a6)    ; set Open() to VIRUS-CONTROL
  1150.  move.l  a0,-28(a6)
  1151.  exg     a4,a6
  1152.  jsr     -126(a6)          ; Enable()
  1153. tt:
  1154.  move.l  $4.w,a6
  1155.  lea     openflag(pc),a0   ; openflag can be set by -o  or Window-Gadget
  1156.  tst.b   (a0)
  1157.  beq.s   tttt
  1158.  bsr     restoreopen       ; restore Open()
  1159. tttt:
  1160.  bsr     wait1             ; wait for 1 sec
  1161.  lea     exitflag(pc),a0   ; is VIRUS-CONTROL to be finished
  1162.  tst.b   (a0)
  1163.  beq.s   noexitflag
  1164.  clr.l   $2e(a6)           ; next reset will no more activate VIRUSCONTROL
  1165.  move.l  oldDOIO(pc),-454(a6) ; restore DOIO-vector -> no more disk-check
  1166.  bsr     restoreopen       ; restore Open()
  1167.  lea     exitcount(pc),a0
  1168.  tst.b   (a0)              ; Warn-Window on screen ?
  1169.  bne.s   tttt              ; wait for no Warn-Window
  1170.  lea     opencount(pc),a0  ; Open()-Requester on screen ?
  1171.  tst.b   (a0)              ; wait for no requester
  1172.  bne.s   tttt              ; because Warn-Window, Requester use programcode.
  1173.  move.l  #5,32(a1)         ; before freemem wait for 5 sec. -> time for all
  1174.  bsr     wait              ; routines, which use this memory, to come to an end
  1175.  bsr     remreqport        ; closedevice + remport
  1176.  bra     freemem           ; freemem + rts->EndTask
  1177. noexitflag:
  1178.  move.l  BeginIOAdr(pc),a0
  1179.  lea     lastBeginIO(pc),a1
  1180.  tst.l   (a1)
  1181.  bne.s   alreadyset
  1182.  move.l  (a0),(a1)+        ; actual BeginIO-vector -> lastBeginIO
  1183.  move.l  (a0),(a1)         ; actual BeginIO-vector -> restoreIO
  1184. alreadyset:
  1185.  cmp.l   #$00fc0000,(a0)   ; if BeginIO points to ROM (z.B. nach Reset),
  1186.  bhs.s   restoreIOROM      ; then use it for restoreIO
  1187.  move.l  lastBeginIO(pc),a2
  1188.  lea     lastBeginIO(pc),a3
  1189.  move.l  (a0),(a3)         ; save actual vector for next comparison
  1190.  cmp.l   (a0),a2           ; BeginIO-vector has been changed in last second ?
  1191.  beq.s   testKICK1         ; not changed
  1192.  lea     vector0text(pc),a0; changed -> Warn-Requester
  1193.  move.l  #"Begi",(a0)+
  1194.  move.l  #"nIO-",(a0)      ; modify Warn-Text for BeginIO-vector
  1195.  bsr     vectoropenwindow
  1196.  bra     taskweiter
  1197. restoreIOROM:              ; Original-BeginIO-vector is needed in deletevirus-
  1198.  lea     restoreIO(pc),a1  ; routine. BeginIO-vector-Handling is somewhat
  1199.  move.l  (a0),(a1)         ; complex to be ROM-version-compatible
  1200.  move.l  (a0),-4(a1)
  1201. testKICK1:
  1202.  tst.l   546(a6)           ; if Kick-vector is changed to 0 -> okay
  1203.  bne.s   testKICK2
  1204.  tst.l   550(a6)
  1205.  bne.s   testKICK2
  1206.  tst.l   554(a6)
  1207.  beq.s   testCool1
  1208. testKICK2:
  1209.  move.l  546(a6),a0
  1210.  move.l  lastKickMem(pc),a2
  1211.  lea     lastKickMem(pc),a3
  1212.  move.l  a0,(a3)           ; save actual vector for next comparison
  1213.  cmp.l   a0,a2             ; KickMemPtr has been changed in last second ?
  1214.  bne.s   kickchanged1
  1215.  move.l  550(a6),a0
  1216.  move.l  lastKickTag(pc),a2
  1217.  lea     lastKickTag(pc),a3
  1218.  move.l  a0,(a3)           ; save actual vector for next comparison
  1219.  cmp.l   a0,a2             ; KickTagPtr has been changed in last second ?
  1220.  bne.s   kickchanged1
  1221.  move.l  554(a6),a0
  1222.  move.l  lastKickCheck(pc),a2
  1223.  lea     lastKickCheck(pc),a3
  1224.  move.l  a0,(a3)           ; save actual KickcheckSum for next comparison
  1225.  cmp.l   a0,a2             ; KickCheckSum has been changed in last second ?
  1226.  beq.s   testcool1
  1227. kickchanged1:
  1228.  lea     vector0text(pc),a0
  1229.  move.l  #"KICK",(a0)+
  1230.  move.l  #" -  ",(a0)
  1231.  bsr.s   vectoropenwindow
  1232.  bra     taskweiter
  1233. testcool1:
  1234.  move.l  pointer(pc),a2    ; a2 = VIRUS-CONTROL-address
  1235.  move.l  46(a6),a0
  1236.  cmp.l   a0,a2             ; COOL-vector points to VIRUS-CONTROL ?
  1237.  beq.s   testDOIO1
  1238.  move.l  lastCOOL(pc),a2
  1239.  lea     lastCOOL(pc),a3
  1240.  move.l  a0,(a3)
  1241.  cmp.l   a0,a2             ; COOL-vector has been changed in last second ?
  1242.  beq.s   testDOIO1
  1243.  lea     vector0text(pc),a0
  1244.  move.l  #"COOL",(a0)+
  1245.  move.l  #" -  ",(a0)
  1246.  bsr.s   vectoropenwindow
  1247.  bra     taskweiter
  1248. testDOIO1:
  1249.  lea     newDOIO(pc),a2
  1250.  move.l  -454(a6),a0
  1251.  cmp.l   a0,a2             ; DOIO-vector points to my (newDOIO-)routine ?
  1252.  beq     taskweiter
  1253.  move.l  lastDOIO(pc),a2
  1254.  lea     lastDOIO(pc),a3
  1255.  move.l  a0,(a3)
  1256.  cmp.l   a0,a2             ; DOIO-vector has been changed in last second ?
  1257.  beq     taskweiter
  1258.  lea     vector0text(pc),a0
  1259.  move.l  #"DOIO",(a0)+
  1260.  move.l  #" -  ",(a0)
  1261.  bsr.s   vectoropenwindow
  1262.  bra     taskweiter
  1263.  
  1264. ; BeginIO-vector, KICK-vector, COOL-vector or DOIO-vector has been changed
  1265. ; -> Warn-Requester, changed by a VIRUS ??
  1266. ; the best and simplest method to get rid of a virus is to switch Amiga off
  1267. vectoropenwindow:
  1268.  lea     vector0(pc),a1
  1269. kill:
  1270.  lea     vectorL(pc),a2
  1271.  lea     NOBOOTR(pc),a3
  1272.  bsr     autorequest
  1273.  tst.l   d0
  1274.  beq.s   vectortested
  1275.  bsr     deletevirus       ; kill Virus
  1276. vectortested:
  1277.  rts
  1278.  
  1279. wait1:
  1280.  lea     timereq(pc),a1
  1281.  move.l  #1,32(a1)         ; wait for 1 sec.
  1282. wait:
  1283.  move.w  #9,28(a1)
  1284.  jmp     -456(a6)
  1285.  
  1286. openwindow:
  1287.  movem.l d1-d7/a0-a6,-(sp) ; save a1=IO-Request
  1288. nopush:
  1289.  move.l  $4.w,a6          ; Forbid() -> set corresponding string-gadget and
  1290.  jsr     -132(a6)         ;             modify information-gadget
  1291.  bsr     OpenIntuition
  1292.  movem.l d1-d7/a0-a6,-(sp)
  1293.  jsr     -342(a6)         ; WBenchToFront()
  1294.  movem.l (sp)+,d1-d7/a0-a6
  1295.  lea     window(pc),a2
  1296.  tst.b   d6
  1297.  bne.s   test1
  1298.  lea     gad90(pc),a1   ; for df0: corresponding Stringgadget
  1299.  move.l  a1,18(a2)      ; with its own buffer
  1300. test1:
  1301.  cmp.b   #1,d6
  1302.  bne.s   test2
  1303.  lea     gad91(pc),a1   ; for df1: corresponding Stringgadget
  1304.  move.l  a1,18(a2)      ; with its own buffer
  1305. test2:
  1306.  cmp.b   #2,d6
  1307.  bne.s   test3
  1308.  lea     gad92(pc),a1   ; for df2: corresponding Stringgadget
  1309.  move.l  a1,18(a2)      ; with its own buffer
  1310. test3:
  1311.  cmp.b   #3,d6
  1312.  bne.s   testende
  1313.  lea     gad93(pc),a1   ; for df3: corresponding Stringgadget
  1314.  move.l  a1,18(a2)      ; with its own buffer
  1315. testende:
  1316.  move.l  34(a1),a4      ; address of StringInfo
  1317.  move.l  (a4),a4        ; a4 = address of buffer(=Filename)
  1318.  bsr     modifyunit     ; modify information-gadget-text
  1319.  lea     window(pc),a0
  1320.  movem.l d1-d7/a0-a6,-(sp)
  1321.  jsr     -204(a6)       ; OpenWindow() (with Gadgets)
  1322.  movem.l (sp)+,d1-d7/a0-a6
  1323.  move.l  d0,d7          ; d7 =  Windowpointer
  1324.  bne.s   openok
  1325.  moveq   #0,d0          ; no more memory for Warn-Window,
  1326.  bsr     optzeichen2    ; therefore black color-signal for suspected disk
  1327.  bra     openwindowerror
  1328. openok:
  1329.  move.l  d7,a0
  1330.  move.l  50(a0),a0      ; RastPort of Window
  1331.  lea     NAME0(pc),a1   ; set virusname
  1332.  moveq   #buff1-buff0+20,d0
  1333.  mulu    d6,d0
  1334.  add.l   d0,a1
  1335.  moveq   #38,d0         ; x
  1336.  moveq   #40,d1         ; y
  1337.  movem.l d0-d7/a0-a6,-(sp)
  1338.  jsr     -216(a6)       ; PrintIText
  1339.  movem.l (sp)+,d0-d7/a0-a6
  1340.  movem.l d0-d7/a0-a6,-(sp)
  1341.  btst    #31,d5         ; test any bit out of 24-31, for instance bit 31
  1342.  beq.s   noonediff      ; GadgetID only uses bit 0-15
  1343.  movem.l (sp)+,d0-d7/a0-a6
  1344.  moveq   #56,d1         ; y
  1345.  lea     ONEDIFF(pc),a1
  1346.  movem.l d0-d7/a0-a6,-(sp)
  1347.  jsr     -216(a6)       ; PrintIText
  1348. noonediff:
  1349.  move.l  $4.w,a6
  1350.  jsr     -138(a6)       ; Permit()
  1351.  movem.l (sp)+,d0-d7/a0-a6
  1352.  move.l  a6,-(sp)       ; save intuitionbase
  1353.  move.l  $4.w,a6
  1354. waitmessage:
  1355.  move.l  d7,a0
  1356.  move.l  86(a0),a0      ; UserPort of Window
  1357.  movem.l d1-d7/a0-a6,-(sp)
  1358.  jsr     -384(a6)       ; WaitPort(UserPort)
  1359.  movem.l (sp)+,d1-d7/a0-a6
  1360.  movem.l d1-d7/a0-a6,-(sp)
  1361.  jsr     -372(a6)       ; GetMsg(UserPort)
  1362.  movem.l (sp)+,d1-d7/a0-a6
  1363.  move.l  d0,a0
  1364.  move.l  d0,a1          ; ReplyMsg needs message in a1
  1365.  move.l  20(a0),d4      ; d4 = Class = IDCMP-Flags
  1366.  cmp.l   #$200,d4       ; if you click a system-gadget, Intuition-Objekt-
  1367.  beq.s   closegadget    ; address is not set, by accident there can be an odd
  1368.  move.l  28(a0),a0      ; address -> if move.w -> TaskHeld
  1369.  move.w  38(a0),d5      ; therfore test if close-gadget
  1370. closegadget:
  1371.  movem.l d1-d7/a0-a6,-(sp)
  1372.  jsr     -378(a6)       ; ReplyMsg(a1=intuimessage), after getting GadgetID
  1373.  movem.l (sp)+,d1-d7/a0-a6
  1374.  cmp.w   #9,d5          ; stringgadget -> wait on
  1375.  beq.s   itis9          ; information-gadget -> wait on
  1376.  cmp.w   #10,d5
  1377.  bne.s   portleeren
  1378. itis9:
  1379.  clr.w   d5
  1380.  bra.s   waitmessage
  1381. portleeren:
  1382.  move.l  d7,a0
  1383.  move.l  86(a0),a0      ; UserPort of Window
  1384.  movem.l d1-d7/a0-a6,-(sp)
  1385.  jsr     -372(a6)       ; GetMsg(UserPort)
  1386.  movem.l (sp)+,d1-d7/a0-a6
  1387.  tst.l   d0
  1388.  beq.s   leerende
  1389.  move.l  d0,a1
  1390.  movem.l d1-d7/a0-a6,-(sp)
  1391.  jsr     -378(a6)       ; ReplyMsg(a1=intuimessage)
  1392.  movem.l (sp)+,d1-d7/a0-a6
  1393.  bra.s   portleeren
  1394. leerende:
  1395.  move.l  (sp)+,a6
  1396.  move.l  d7,a0
  1397.  movem.l d1-d7/a0-a6,-(sp)
  1398.  jsr     -72(a6)        ; CloseWindow()
  1399.  movem.l (sp)+,d1-d7/a0-a6
  1400.  move.l  a6,a1
  1401.  move.l  $4.w,a6
  1402.  movem.l d1-d7/a0-a6,-(sp)
  1403.  jsr     -414(a6)       ; CloseLibrary("intuition.library")
  1404.  movem.l (sp)+,d1-d7/a0-a6
  1405.  
  1406.  cmp.l   #$200,d4       ; CloseWindow-Gadget -> end
  1407.  bne.s   testgad0
  1408. openwindowerror:
  1409.  movem.l (sp)+,d1-d7/a0-a6
  1410.  bra     DOIOweiter
  1411.  
  1412. ; closewindow breaks loop
  1413. testgad0:
  1414.  tst.w   d5
  1415.  bne.s   testgad1          ; colorsignal
  1416.  jsr     -132(a6)
  1417.  lea     colorflag(pc),a0
  1418.  not.b   (a0)
  1419.  lea     gadtext0text(pc),a1
  1420.  move.l  #"OFF ",14(a1)
  1421.  tst.b   (a0)
  1422.  beq.s   aus
  1423.  move.l  #" ON ",14(a1)
  1424. aus:
  1425.  jsr     -138(a6)
  1426.  bra     nopush
  1427. testgad1:                  ; Bootblock -> Screen
  1428.  cmp.w   #1,d5
  1429.  bne.s   testgad2
  1430.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1431.  lea     filename(pc),a4
  1432.  bra     showbootblock
  1433.  
  1434. testgad2:
  1435.  cmp.w   #2,d5
  1436.  bne.s   testgad3          ; Bootblock -> File
  1437.  move.l  a4,d0             ; movem overwrites a4
  1438.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1439.  move.l  d0,a4
  1440.  bsr     namecorrect
  1441.  beq     openwindow
  1442.  bra     showbootblock
  1443.  
  1444. testgad3:
  1445.  cmp.w   #3,d5
  1446.  bne     testgad4          ; File -> Bootblock
  1447.  move.l  a4,d0             ; movem overwrites a4
  1448.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1449.  move.l  d0,a4
  1450.  bsr     namecorrect
  1451.  beq     openwindow
  1452.  bsr     reallyoverwrite
  1453.  beq     openwindow
  1454.  movem.l d0-d7/a0-a6,-(sp)
  1455.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  1456.  move.l  a4,d1             ; d1=Filename-address
  1457.  move.l  #1004,d2          ; MODE_READWRITE to open existing file,
  1458.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  1459.  tst.l   d0                ; wrong data
  1460.  beq.s   deviceunknown1
  1461.  movem.l d1-d7/a0-a6,-(sp)
  1462.  jsr     -30(a6)
  1463.  movem.l (sp)+,d1-d7/a0-a6
  1464.  tst.l   d0                ; Device write-protected
  1465.  bne.s   noErrorFile       ; -> AmigaDOS-Autorequester
  1466. deviceunknown1:
  1467.  bsr     openerror         ; OpenError, for instance if not existing
  1468.  bra     OpenFailed        ; or EXCLUSIVE_LOCK by other process
  1469. noErrorFile:               ; -> own requester
  1470.  move.l  d0,d1             ; filehandle
  1471.  move.l  a5,d2             ; d2 = read-buffer
  1472.  move.l  #1024,d3          ; d3 = number of read-data
  1473.  movem.l d0-d7/a0-a6,-(sp)
  1474.  jsr     -42(a6)           ; Read() 1024 Bytes from file
  1475.  movem.l (sp)+,d0-d7/a0-a6
  1476.  move.l  $4.w,a3
  1477.  exg     a3,a6
  1478.  bsr     bootblockwrite    ; and write it as Bootblock
  1479.  exg     a3,a6
  1480.  bra     CloseFileDOS
  1481.  
  1482. testgad4:
  1483.  cmp.w   #4,d5
  1484.  bne.s   testgad5          ; Standard-Bootblock
  1485.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1486.  bsr     reallyoverwrite
  1487.  beq     openwindow
  1488.  bsr     bootblockclear    ; clear bootblock
  1489.  lea     bootblock(pc),a0
  1490.  moveq   #bootblockend-bootblock-1,d0
  1491. loop7:
  1492.  move.b  (a0)+,(a2)+
  1493.  dbra    d0,loop7          ; copy StandardBootblock in buffer
  1494.  bsr     bootblockwrite
  1495.  bra     openwindow
  1496.  
  1497. testgad5:
  1498.  cmp.w   #5,d5
  1499.  bne.s   testgad6          ; NoFastMem-Bootblock
  1500.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1501.  bsr     reallyoverwrite
  1502.  beq     openwindow
  1503.  bsr     bootblockclear    ; clear bootblock
  1504.  lea     nofastbootblock(pc),a0
  1505.  move.l  #nofastbootblockend-nofastbootblock-1,d0
  1506.  bra.s   loop7             ; write NoFastMemBootblock
  1507.  
  1508. testgad6:
  1509.  cmp.w   #6,d5
  1510.  bne.s   testgad7          ; false Checksum -> Boot is not possible
  1511.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1512.  bsr     Checksumfalsch
  1513.  bra     openwindow
  1514.  
  1515. testgad7:
  1516.  cmp.w   #7,d5
  1517.  bne.s   testgad8          ; correct Checksum -> Boot is possible
  1518.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1519.  bsr     Checksumrichtig
  1520.  bra     openwindow
  1521.  
  1522. testgad8:                  ; remove Virus-Control
  1523.  cmp.w   #8,d5
  1524.  bne.s   testgad11
  1525.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1526.  bsr     reallyexit        ; really
  1527.  beq     openwindow
  1528.  lea     exitflag(pc),a0
  1529.  move.b  #$ff,(a0)         ; set exitflag for vector-Control-Task
  1530.  bra     DOIOweiter
  1531.  
  1532. testgad11:
  1533.  cmp.w   #11,d5
  1534.  bne     testgad12         ; in NoWarning-File
  1535.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1536.  movem.l d0-d7/a0-a6,-(sp)
  1537.  lea     freeposition(pc),a0
  1538.  clr.l   (a0)
  1539.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  1540.  lea     NoWarning(pc),a0
  1541.  move.l  a0,d1             ; Filename
  1542.  move.l  #1004,d2          ; MODE_READWRITE, to open existing S:NoWarning-File
  1543.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  1544.  tst.l   d0                ; wrong data.
  1545.  beq.s   unknowndevice2
  1546.  movem.l d1-d7/a0-a6,-(sp)
  1547.  jsr     -30(a6)
  1548.  movem.l (sp)+,d1-d7/a0-a6
  1549.  tst.l   d0
  1550.  bne.s   noErrorNoWarning
  1551.  move.l  #1006,d2          ; MODE_NEWFILE(=EXCLUSIVE_LOCK) to create
  1552.  movem.l d1-d7/a0-a6,-(sp) ; S:NoWarning-File
  1553.  jsr     -30(a6)
  1554.  movem.l (sp)+,d1-d7/a0-a6
  1555.  tst.l   d0
  1556.  bne.s   noErrorNoWarning  ; OpenError, because of EXCLUSIVE_LOCK by
  1557. unknowndevice2:            ; other process
  1558.  bsr     openerror
  1559.  bra     OpenFailed
  1560. noErrorNoWarning:
  1561.  move.l  d0,d1             ; filehandle
  1562. nextbootblock2:
  1563.  move.l  a5,a2
  1564.  lea     Nobuff(pc),a0
  1565.  move.l  a0,d2             ; use vectorcontrolTask-Stackbottom as 1024-buffer
  1566.  move.l  #1024,d3
  1567.  movem.l d1-d7/a0-a6,-(sp)
  1568.  jsr     -42(a6)           ; read first Bootblock from S:NoWarning lesen
  1569.  movem.l (sp)+,d1-d7/a0-a6
  1570.  cmp.l   #1024,d0          ; no more Bootblock -> end of file
  1571.  bne     appendnext        ; search file for bootblock ( notice free Block )
  1572.  move.w  #$ff,d0           ; if there is not such a bootblock, write bootblock
  1573. NoWarningloop2:            ; to free position or append to file.
  1574.  cmp.l   #"FREE",(a0)
  1575.  bne.s   notfree
  1576.  bsr     getposition
  1577. notfree:
  1578.  cmpm.l  (a0)+,(a2)+
  1579.  bne.s   nextbootblock2
  1580.  dbra    d0,NoWarningloop2
  1581.  bsr     alreadynoset      ; Bootblock already exists in S:NoWarning
  1582.  beq     CloseFileDOS
  1583.  bsr     getposition
  1584.  sub.l   #1024,d0
  1585.  move.l  d0,d2
  1586.  bsr     seekback1
  1587.  move.l  (a5),-(sp)        ; save
  1588.  move.l  #"FREE",(a5)
  1589.  move.l  a5,d2             ; d2=bootblockbuffer
  1590.  move.l  #1024,d3          ; d3=number of write-bytes
  1591.  movem.l d1-d7/a0-a6,-(sp)
  1592.  jsr     -48(a6)           ; mark Bootblock as FREE
  1593.  movem.l (sp)+,d1-d7/a0-a6
  1594.  move.l  (sp)+,(a5)        ; restore
  1595.  bra     CloseFileDOS
  1596.  
  1597. testgad12:                 ; in VirusName-File
  1598.  cmp.w   #12,d5
  1599.  bne     testgad13
  1600.  move.l  a4,d0             ; movem will overwrite a4
  1601.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1602.  move.l  d0,a4
  1603.  bsr     namecorrect
  1604.  beq     openwindow
  1605.  movem.l d0-d7/a0-a6,-(sp)
  1606.  lea     freeposition(pc),a0
  1607.  clr.l   (a0)
  1608.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  1609.  lea     VirusName(pc),a0
  1610.  move.l  a0,d1             ; Filename
  1611.  move.l  #1004,d2          ; MODE_READWRITE, to open existing S:VirusName-File
  1612.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  1613.  tst.l   d0                ; wrong data.
  1614.  beq.s   unknowndevice3
  1615.  movem.l d1-d7/a0-a6,-(sp)
  1616.  jsr     -30(a6)
  1617.  movem.l (sp)+,d1-d7/a0-a6
  1618.  tst.l   d0
  1619.  bne.s   noErrorVirusName
  1620.  move.l  #1006,d2          ; MODE_NEWFILE(=EXCLUSIVE_LOCK) to create
  1621.  movem.l d1-d7/a0-a6,-(sp) ; S:VirusName-File
  1622.  jsr     -30(a6)
  1623.  movem.l (sp)+,d1-d7/a0-a6
  1624.  tst.l   d0
  1625.  bne.s   noErrorVirusName  ; OpenError, because of EXCLUSIVE_LOCK by
  1626. unknowndevice3:            ; other process
  1627.  bsr     openerror
  1628.  bra     OpenFailed
  1629. noErrorVirusName:
  1630.  move.l  d0,d1             ; filehandle
  1631. nextbootblock3:
  1632.  lea     onediff1(pc),a0
  1633.  clr.b   (a0)
  1634.  lea     Vibuff(pc),a0
  1635.  move.l  a0,d2               ; use vectorcontrolTask-Stackbottom
  1636.  move.l  #1024+buff1-buff0,d3; as 1024+32 buffer
  1637.  movem.l d1-d7/a0-a6,-(sp)
  1638.  jsr     -42(a6)             ; read first Virusname+Bootblock from S:VirusName
  1639.  movem.l (sp)+,d1-d7/a0-a6
  1640.  cmp.l   #1024+buff1-buff0,d0
  1641.  bne.s   fileende2
  1642.  lea     oldname(pc),a2
  1643.  bsr     copyname
  1644.  move.w  #$ff,d0
  1645.  move.l  a5,a2
  1646. VirusNameloop1:
  1647.  cmp.l   #"FREE",(a0)
  1648.  bne.s   notfree1
  1649.  bsr     getposition       ; while searching for bootblock,
  1650. notfree1:                  ; notice free-bootblock
  1651.  cmpm.l  (a0)+,(a2)+
  1652.  beq.s   issame1
  1653.  movem.l a0/a1,-(sp)
  1654.  lea     onediff1(pc),a0
  1655.  tst.b   (a0)
  1656.  movem.l (sp)+,a0/a1
  1657.  bne.s   nextbootblock3
  1658. countit1:
  1659.  movem.l a0/a1,-(sp)
  1660.  lea     onediff1(pc),a0   ; set flag for 1 Longword-difference
  1661.  move.b  #$ff,(a0)
  1662.  movem.l (sp)+,a0/a1
  1663. issame1:
  1664.  dbra    d0,VirusNameloop1
  1665.  bsr     alreadyviset         ; found !
  1666.  beq     CloseFileDOS
  1667.  bsr     getposition
  1668.  sub.l   #1024+buff1-buff0,d0 ; minus 1 entry
  1669.  move.l  d0,d2
  1670.  bsr     seekback1
  1671.  move.l  a4,a0
  1672.  lea     nameoverwrite(pc),a2
  1673.  bsr     copyname
  1674.  bsr     alreadyviwork
  1675.  beq.s   nixfrei3          ; overwrite with new name
  1676.  move.l  #"FREE",(a5)
  1677.  bra.s   nixfrei3          ; mark as FREE
  1678. fileende2:                 ; not found !
  1679.  move.l  freeposition(pc),d2
  1680.  beq.s   nixfrei3          ; if free entry -> use this
  1681.  sub.l   #1024+buff1-buff0,d2
  1682.  bsr     seekback1
  1683. nixfrei3:
  1684.  move.l  a4,d2             ; 32-byte-VirusName
  1685.  moveq   #buff1-buff0,d3
  1686.  movem.l d1-d7/a0-a6,-(sp)
  1687.  jsr     -48(a6)           ; append VirusName to S:VirusName
  1688.  movem.l (sp)+,d1-d7/a0-a6
  1689.  bra.s   nixfrei
  1690. appendnext:
  1691.  move.l  freeposition(pc),d2
  1692.  beq.s   nixfrei           ; if free entry -> use this
  1693.  sub.l   #1024,d2
  1694.  bsr     seekback1
  1695. nixfrei:
  1696.  move.l  a5,d2             ; d2 = bootblockbuffer
  1697.  move.l  #1024,d3          ; d3 = number of write-bytes
  1698.  movem.l d1-d7/a0-a6,-(sp)
  1699.  jsr     -48(a6)           ; append bootblock to file
  1700.  movem.l (sp)+,d1-d7/a0-a6 ; stack will be restored in CloseFileDos,
  1701.  move.l  $4.w,a3           ; nevertheless you can call bootblockread,
  1702.  exg     a3,a6             ; because a1=IORequest is not changed.
  1703.  bsr     bootblockread     ; bootblockread does not change d1=filehandle.
  1704.  exg     a3,a6             ; bootblockread restores bootblockbuffer
  1705.  bra     CloseFileDOS
  1706.  
  1707. testgad13:                 ; deletevirus
  1708.  cmp.w   #13,d5
  1709.  bne.s   testgad14
  1710.  lea     gadtext13(pc),a1  ; 'invisible' colors
  1711.  bsr     kill              ; a6=exec.base
  1712.  bra     nopush
  1713.  
  1714. testgad14:                 ; File - Protection
  1715.  cmp.w   #14,d5
  1716.  bne     testgad15
  1717.  move.l  a4,d0
  1718.  movem.l (sp)+,d1-d7/a0-a6 ; a1=IORequest
  1719.  move.l  d0,a4
  1720.  moveq   #0,d4             ; clear flag for check directory (noloadfi:)
  1721.  movem.l d0-d7/a0-a6,-(sp)
  1722.  bsr     OpenDOS           ; OpenLibrary("dos.library",0);
  1723.  move.l  a4,d1             ; Filename
  1724.  move.l  #1004,d2          ; MODE_READWRITE, to open existing file
  1725.  bsr     checkdevicename   ; EXCLUSIVE_LOCK, because multiple use could produce
  1726.  tst.l   d0                ; wrong data.
  1727.  beq     nodirectory
  1728.  movem.l d1-d7/a0-a6,-(sp)
  1729.  jsr     -30(a6)
  1730.  movem.l (sp)+,d1-d7/a0-a6
  1731.  tst.l   d0
  1732.  bne     noErrorFile1
  1733.  move.l  a4,d1             ; Directory ?
  1734.  moveq   #-2,d2            ; ACCESS_READ
  1735.  movem.l d1-d7/a0-a6,-(sp)
  1736.  jsr     -84(a6)           ; Lock()
  1737.  movem.l (sp)+,d1-d7/a0-a6
  1738.  tst.l   d0
  1739.  beq     nodirectory       ; neither file nor directory
  1740.  move.l  d0,-(sp)          ; SAVE for Unlock()
  1741.  move.l  d0,d1
  1742.  movem.l d1-d7/a0-a6,-(sp)
  1743.  jsr     -126(a6)          ; cd directory
  1744.  movem.l (sp)+,d1-d7/a0-a6
  1745.  move.l  d0,-(sp)          ; SAVE for restoration
  1746.  movem.l d1-d7/a0-a6,-(sp)
  1747.  move.l  #260,d0
  1748.  moveq   #1,d1
  1749.  move.l  $4.w,a6           ; allocate memory for struct FileInfoBlock
  1750.  jsr     -198(a6)
  1751.  movem.l (sp)+,d1-d7/a0-a6
  1752.  move.l  d0,d2
  1753.  beq.s   mmm
  1754.  move.l  d0,-(sp)          ; SAVE address of memory
  1755.  move.l  8(sp),d1
  1756.  movem.l d1-d7/a0-a6,-(sp)
  1757.  jsr     -102(a6)          ; Examine()
  1758.  movem.l (sp)+,d1-d7/a0-a6
  1759.  moveq   #-1,d4            ; Flag for check directory (noloadfi:)
  1760. exnext:
  1761.  move.l  8(sp),d1          ; Lock
  1762.  move.l  (sp),d2           ; memory-address of FileInfoBlock
  1763.  movem.l d1-d7/a0-a6,-(sp)
  1764.  jsr     -108(a6)          ; ExNext()
  1765.  movem.l (sp)+,d1-d7/a0-a6
  1766.  tst.l   d0                ; d0=0 -> no more files
  1767.  beq.s   kkk
  1768.  move.l  d2,a0
  1769.  lea     8(a0),a4
  1770.  move.l  a4,d1             ; Filename
  1771.  move.l  #1004,d2          ; MODE_READWRITE, to open existing file
  1772.  movem.l d1-d7/a0-a6,-(sp) ; EXCLUSIVE_LOCK, because multiple use could produce
  1773.  jsr     -30(a6)           ; wrong data.
  1774.  movem.l (sp)+,d1-d7/a0-a6
  1775.  tst.l   d0
  1776.  bne.s   noErrorFile1
  1777.  bra.s   exnext            ; if Directory
  1778. kkk:
  1779.  move.l  a1,a0             ; save IORequest
  1780.  move.l  (sp)+,a1
  1781.  move.l  #260,d0
  1782.  movem.l d1-d7/a0-a6,-(sp)
  1783.  move.l  $4.w,a6
  1784.  jsr     -210(a6)          ; FreeMem
  1785.  movem.l (sp)+,d1-d7/a0-a6
  1786.  move.l  a0,a1
  1787. mmm:
  1788.  move.l  (sp)+,d1
  1789.  movem.l d1-d7/a0-a6,-(sp)
  1790.  jsr     -126(a6)          ; restore cd
  1791.  movem.l (sp)+,d1-d7/a0-a6
  1792.  move.l  (sp)+,d1
  1793.  movem.l d1-d7/a0-a6,-(sp)
  1794.  jsr     -90(a6)           ; Unlock()
  1795.  movem.l (sp)+,d1-d7/a0-a6
  1796.  move.l  $4.w,a3           ; stack will be restored in Openfailed,
  1797.  exg     a3,a6             ; nevertheless you can call bootblockread,
  1798.  bsr     bootblockread     ; because a1=IORequest is not changed.
  1799.  exg     a3,a6             ; bootblockread does not change d1=filehandle.
  1800.  bra     Openfailed        ; bootblockread restores bootblockbuffer
  1801. nodirectory:
  1802.  bsr     openerror         ; OpenError(wrong filename)->own requester
  1803.  bra     OpenFailed
  1804. noErrorFile1:
  1805.  move.l  d0,d1             ; filehandle
  1806. nextbootblock4:
  1807.  move.l  a5,a0
  1808.  bsr     clear1024
  1809.  bsr     testfile          ; read first 1024 bytes from file
  1810.  cmp.l   #$000003f3,(a5)
  1811.  beq.s   isloadfile
  1812.  bsr     noloadfile
  1813.  bra     noloadfi
  1814. isloadfile:
  1815.  move.w  #$ff,d0
  1816.  move.l  a5,a2             ; d0,a2 counter
  1817. piusloop:
  1818.  cmp.l   #$000003e8,(a2)+
  1819.  bne.s   cvb
  1820.  subq.l  #1,d0
  1821.  bpl.s   yyx
  1822.  bsr     testfile          ; next 1024 Bytes
  1823.  tst.l   d0                ; end of file ?
  1824.  beq.s   bbn
  1825.  move.w  #$ff,d0
  1826.  move.l  a5,a2             ; d0,a2 counter
  1827. yyx:
  1828.  cmp.l   #$00000002,(a2)+
  1829.  bne.s   cvb
  1830.  subq.l  #1,d0
  1831.  bpl.s   yyy
  1832.  bsr     testfile          ; next 1024 Bytes
  1833.  tst.l   d0                ; end of file ?
  1834.  beq.s   bbn
  1835.  move.w  #$ff,d0
  1836.  move.l  a5,a2             ; d0,a2 counter
  1837. yyy:
  1838.  cmp.l   #"PIUS",(a2)+
  1839.  beq.s   marked
  1840. cvb:
  1841.  dbra    d0,piusloop
  1842.  bsr     testfile          ; next 1024 Bytes
  1843.  tst.l   d0                ; end of file ?
  1844.  bne.s   isloadfile
  1845. bbn:
  1846.  bsr     schuetzenodweiter
  1847.  beq     noloadfi
  1848.  bsr     setend            ; get file-length
  1849.  lea     Kennung(pc),a0
  1850.  move.l  d0,Kennzahl-Kennung(a0)
  1851.  move.l  a0,d2
  1852.  moveq   #20,d3
  1853.  movem.l d0-d7/a0-a6,-(sp)
  1854.  jsr     -48(a6)           ; append MARK to file
  1855.  movem.l (sp)+,d0-d7/a0-a6
  1856.  bra     noloadfi
  1857. marked:
  1858.  tst.l   d0                ; has to be read next 1024-block, ?
  1859.  bne.s   notblockend       ; because I need original-filelength
  1860.  bsr     testfile
  1861.  move.l  a5,a2
  1862. notblockend:
  1863.  bsr     setend            ; setend returns d0=actual filelength
  1864.  sub.l   #20,d0            ; minus MARK
  1865.  move.l  d0,d7             ; save filelength
  1866.  cmp.l   (a2),d0           ; d0=actual filelength  a2=original filelength
  1867.  beq.s   fileokay
  1868.  bsr     filedanger
  1869.  bra     noloadfi
  1870. fileokay:
  1871.  bsr     FileIsOkay
  1872. noloadfi:
  1873.  tst.l   d4
  1874.  beq.s   onlyfile
  1875.  movem.l d1-d7/a0-a6,-(sp)
  1876.  jsr     -36(a6)           ; Close() file
  1877.  movem.l (sp)+,d1-d7/a0-a6
  1878.  bra     exnext
  1879. onlyfile:
  1880.  move.l  $4.w,a3           ; stack will be restored in CloseFileDos,
  1881.  exg     a3,a6             ; nevertheless you can call bootblockread,
  1882.  bsr     bootblockread     ; because a1=IORequest is not changed.
  1883.  exg     a3,a6             ; bootblockread does not change d1=filehandle.
  1884.  bra     CloseFileDOS      ; bootblockread restores bootblockbuffer
  1885.  
  1886. testgad15:                 ; CheckOpen
  1887.  cmp.w   #15,d5
  1888.  bne.s   testgad16
  1889.  jsr     -132(a6)
  1890.  lea     openflag(pc),a0
  1891.  not.b   (a0)
  1892.  lea     gadtext15text(pc),a1
  1893.  move.l  #"OFF ",14(a1)
  1894.  tst.b   (a0)
  1895.  bne.s   aus1
  1896.  move.l  #" ON ",14(a1)
  1897. aus1:
  1898.  jsr     -138(a6)
  1899.  bra     nopush
  1900.  
  1901. testgad16:                 ; search files
  1902. ; cmp.w   #16,d5
  1903. ; bne.s   testgad17
  1904.  jsr     -132(a6)
  1905.  lea     searchfiles(pc),a0
  1906.  not.b   (a0)
  1907.  lea     gadtext16text(pc),a1
  1908.  move.l  #"OFF ",14(a1)
  1909.  tst.b   (a0)
  1910.  beq.s   aus2
  1911.  move.l  #" ON ",14(a1)
  1912. aus2:
  1913.  jsr     -138(a6)
  1914.  bra     nopush
  1915.  
  1916. ; testgad17:
  1917.  
  1918. namecorrect:
  1919.  movem.l a0-a3,-(sp)
  1920.  jsr     -132(a6)
  1921.  move.l  a4,a0
  1922.  lea     correctname(pc),a2; copy actual contents of Stringadget-buffer
  1923.  bsr     copyname          ; into Intuitext-structure
  1924.  bsr     modifyunit        ; and ask if okay
  1925.  lea     CORRECT(pc) ,a1
  1926.  bra.s   shorter1
  1927.  
  1928. reallyexit:
  1929.  movem.l a0-a3,-(sp)       ; really remove VirusControl
  1930.  jsr     -132(a6)
  1931.  lea     EXIT(pc) ,a1
  1932.  bra.s   shorter1
  1933.  
  1934. writebbzugriff:
  1935.  movem.l a0-a3,-(sp)       ; change bootblock-write-access to read-access ?
  1936.  jsr     -132(a6)
  1937.  bsr     modifyunit
  1938.  lea     WRITEBB(pc) ,a1
  1939.  bra.s   shorter1
  1940.  
  1941. reallyoverwrite:
  1942.  movem.l a0-a3,-(sp)       ; really overwrite bootblock
  1943.  jsr     -132(a6)
  1944.  bsr     modifyunit
  1945.  lea     OVERWRITE(pc) ,a1
  1946. shorter1:
  1947.  lea     OVERWRITEL(pc),a2
  1948.  lea     OVERWRITER(pc),a3
  1949. shorter2:
  1950.  bsr     autorequest
  1951.  jsr     -138(a6)
  1952.  movem.l (sp)+,a0-a3
  1953.  tst.l   d0                ; rts does not change flags
  1954.  rts
  1955.  
  1956. fileprotect:
  1957.  movem.l a0-a3,-(sp)
  1958.  jsr     -132(a6)
  1959.  move.l  a4,a0
  1960.  lea     checkfilename(pc),a2
  1961.  bsr     copyname
  1962.  lea     FILESCHUTZ(pc),a1
  1963.  bra.s   shorter1
  1964.  
  1965. openerror:                 ; requester for Open-Error
  1966.  movem.l a0-a6,-(sp)       ; save a6=dosbase
  1967.  move.l  $4.w,a6           ; autorequest: needs a6=exec.base
  1968.  jsr     -132(a6)
  1969.  bsr     modifyunit
  1970.  lea     OPENERR(pc),a1
  1971. shorter7:
  1972.  lea     NOBOOTR(pc),a2
  1973. shorter5:
  1974.  lea     NOBOOTR(pc),a3
  1975. shorter6:
  1976.  bsr     autorequest
  1977.  jsr     -138(a6)
  1978.  movem.l (sp)+,a0-a6
  1979.  tst.l   d0
  1980.  rts
  1981.  
  1982. alreadynoset:              ; requester for bootblock already in
  1983.  movem.l a0-a6,-(sp)       ; S:NoWarning
  1984.  move.l  $4.w,a6
  1985.  jsr     -132(a6)
  1986.  bsr     modifyunit
  1987.  lea     ALREADYNO(pc),a1
  1988.  lea     ALREADYNOdel(pc),a2
  1989.  bra.s   shorter5
  1990.  
  1991. alreadyviset:              ; requester for bootblock already in
  1992.  movem.l a0-a6,-(sp)       ; S:VirusName
  1993.  move.l  $4.w,a6
  1994.  jsr     -132(a6)
  1995.  bsr     modifyunit
  1996.  lea     ALREADYVI(pc),a1
  1997.  lea     ALREADYWORK(pc),a2
  1998.  bra.s   shorter5
  1999.  
  2000. alreadyviwork:             ; requester to remove bootblock+name from
  2001.  movem.l a0-a6,-(sp)       ; S:VirusName or to overwrite old name by new name
  2002.  move.l  $4.w,a6
  2003.  jsr     -132(a6)
  2004.  bsr     modifyunit
  2005.  lea     ALREADYVI(pc),a1
  2006.  lea     ALREADYNOdel(pc),a2
  2007.  lea     ALREADYNOnam(pc),a3
  2008.  bra.s   shorter6
  2009.  
  2010. noloadfile:
  2011.  movem.l a0-a6,-(sp)       ; save a6=dosbase
  2012.  move.l  $4.w,a6           ; forbid(),autorequest: needs a6=exec.base
  2013.  jsr     -132(a6)
  2014.  move.l  a4,a0
  2015.  lea     keinloadfile(pc),a2
  2016.  bsr     copyname
  2017.  lea     noloadf(pc),a1
  2018.  bra     shorter7
  2019.  
  2020. filedanger:
  2021.  movem.l a0-a6,-(sp)       ; save a6=dosbase
  2022.  move.l  $4.w,a6           ; forbid(),autorequest: needs a6=exec.base
  2023.  jsr     -132(a6)
  2024.  move.l  a4,a0
  2025.  lea     linkname(pc),a2
  2026.  bsr     copyname
  2027.  lea     link(pc),a1
  2028.  bra     shorter7
  2029.  
  2030. FileIsOkay:
  2031.  movem.l a0-a6,-(sp)       ; save a6=dosbase
  2032.  move.l  $4.w,a6           ; forbid(),autorequest: needs a6=exec.base
  2033.  jsr     -132(a6)
  2034.  move.l  a4,a0
  2035.  lea     checkfilename(pc),a2
  2036.  bsr     copyname
  2037.  lea     FILESCHUTZ(pc),a1
  2038.  lea     okk(pc),a2
  2039.  lea     okk(pc),a3
  2040.  bra     shorter6
  2041.  
  2042. schuetzenodweiter:
  2043.  movem.l a0-a6,-(sp)       ; save a6=dosbase
  2044.  move.l  $4.w,a6           ; forbid(),autorequest: needs a6=exec.base
  2045.  jsr     -132(a6)
  2046.  move.l  a4,a0
  2047.  lea     checkfilename(pc),a2
  2048.  bsr     copyname
  2049.  lea     FILESCHUTZ(pc),a1
  2050.  lea     neusch(pc),a2
  2051.  bra     shorter5
  2052.  
  2053. allowaccess:
  2054.  movem.l a0-a3,-(sp)       ; allow file-access ?
  2055.  move.l  $4.w,a6
  2056.  jsr     -132(a6)
  2057.  move.l  d1,a0
  2058.  lea     filewrite(pc),a2
  2059.  bsr     copyname
  2060.  lea     OPENFILEnam(pc) ,a1
  2061.  bra     shorter1
  2062.  
  2063. getposition:
  2064.  moveq   #0,d2
  2065.  moveq   #0,d3
  2066.  movem.l d1-d7/a0-a6,-(sp)
  2067.  jsr     -66(a6)           ; Seek() -> get actual fileposition
  2068.  lea     freeposition(pc),a0
  2069.  move.l  d0,(a0)           ; save position
  2070.  movem.l (sp)+,d1-d7/a0-a6
  2071.  rts
  2072.  
  2073. seekback1:
  2074.  moveq   #-1,d3
  2075. seekit:
  2076.  movem.l d1-d7/a0-a6,-(sp)
  2077.  jsr     -66(a6)
  2078.  movem.l (sp)+,d1-d7/a0-a6
  2079.  rts
  2080.  
  2081. addtask:
  2082.  ; start vector-control-task, which checks system-vectors every second.
  2083.  ; in coolroutine you cannot call addtask -> guru.
  2084.  ; only a few exec-functions can be used in coolroutine.
  2085.  movem.l d0-d7/a0-a6,-(sp);
  2086.  lea     structtask(pc),a1
  2087.  lea     task(pc),a2
  2088.  sub.l   a3,a3          ; 2 Bytes, move.l #0,a3 needs 6 Bytes
  2089.  jsr     -282(a6)       ; addtask
  2090.  movem.l (sp)+,d0-d7/a0-a6
  2091.  rts
  2092.  
  2093. deletevirus:
  2094.  bsr     optzeichen
  2095.  clr.l   546(a6)           ; clear KickMemPtr
  2096.  clr.l   550(a6)           ; clear KickTagPtr
  2097.  clr.l   554(a6)           ; clear KickCheckSum
  2098.  clr.l   42(a6)            ; clear COLD-vector
  2099.  move.l  58(a6),a0         ; clear 1024 Bytes at Supervisorstackbottom,
  2100.  bsr.s   clear1024         ; because sometimes there are viruses
  2101.  move.l  BeginIOAdr(pc),a0 ; set Original-BeginIO-vector
  2102.  move.l  restoreIO(pc),(a0); all ROM-version-compatible
  2103. VCrestore:
  2104.  lea     lastBeginIO(pc),a0; clear last BeginIO
  2105.  clr.l   (a0)
  2106.  lea     lastKickMem(pc),a0
  2107.  clr.l   (a0)+             ; clear lastKickMem
  2108.  clr.l   (a0)+             ; clear lastKickTag
  2109.  clr.l   (a0)              ; clear lastKickCheck
  2110.  lea     newDOIO(pc),a0    ; reset restores DOIO -> DOIO has to be set to
  2111.  move.l  a0,-454(a6)       ;                        Virus-control
  2112.  move.l  a0,-(sp)
  2113.  lea     lastDOIO(pc),a0   ; set VIRUS-CONTROL-DOIO as lastDOIO
  2114.  move.l  (sp)+,(a0)
  2115. execchecksum:
  2116.  lea     lastCOOL(pc),a0
  2117.  move.l  pointer(pc),(a0)   ; set VIRUS-CONTROL-COOL as lastCOOL
  2118.  move.l  pointer(pc),$2e(a6); set Cool-vector to VIRUS-CONTROL
  2119.  lea     $22(a6),a0         ; calc new execchecksum
  2120.  clr.w   d0                 ; Cool-vector and execchecksum is not changed by
  2121.  moveq   #$17,d1            ; Reset
  2122. execcheck:
  2123.  add.w   (a0)+,d0
  2124.  dbra    d1,execcheck
  2125.  not.w   d0
  2126.  move.w  d0,(a0)
  2127.  rts
  2128.  
  2129. clear1024:              ; clear 256*4=1024 Bytes
  2130.  move.w   #$00ff,d0     ; dbra uses word
  2131. clearloop:              ; call clearloop with d0=$007f clears 128*4=512 Bytes
  2132.  clr.l   (a0)+
  2133.  dbra    d0,clearloop
  2134.  rts
  2135.  
  2136. Bootblockclear:
  2137.  move.l  a5,a0
  2138.  move.l  a0,a2
  2139.  bra.s   clear1024
  2140.  
  2141. nameunknown:
  2142.  movem.l d0-d7/a0-a6,-(sp)
  2143.  lea     NAME0text(pc),a2
  2144.  moveq   #buff1-buff0+20,d0
  2145.  mulu    d6,d0
  2146.  add.l   d0,a2
  2147.  lea     unknown(pc),a0
  2148.  bsr.s   copyname
  2149.  movem.l (sp)+,d0-d7/a0-a6
  2150.  rts
  2151.  
  2152. copyname:
  2153.  moveq   #buff1-buff0-1,d0
  2154. copyvirusname:
  2155.  move.b  (a0)+,(a2)+
  2156.  dbra    d0,copyvirusname
  2157.  rts
  2158.  
  2159. checkdevicename:           ; df0:-trackdisk.device-task often task-held,
  2160.  movem.l d1-d7/a0-a6,-(sp) ; if you try to open an not existing device
  2161.  move.l  d1,a4             ; df1: df2: df3:-trackdisk.device-task never
  2162.  move.l  d1,a0             ; task-held, but it appears an AmigaDOSAutorequester
  2163.  move.l  $4.w,a3           ; why only df0:-task-held ???
  2164.  exg     a3,a6             ; to prevent df0:-task-held, check devicename,
  2165.  jsr     -132(a6)          ; before Open()
  2166.  exg     a3,a6
  2167.  moveq   #-1,d0
  2168. isitdevice:
  2169.  tst.b   (a0)              ; Filename
  2170.  beq.s   searchend         ; no devicename -> end with d0=$ffffffff
  2171.  cmp.b   #":",(a0)+
  2172.  bne.s   isitdevice
  2173.  move.l  34(a6),a0         ; RootNode
  2174.  move.l  24(a0),d0         ; DosInfo
  2175.  lsl.l   #2,d0             ; BPTR * 4 = APTR
  2176.  move.l  d0,a0
  2177.  move.l  4(a0),d0          ; DevInfo
  2178. nextdevice:
  2179.  move.l  a4,a3             ; a3 = Filename-address
  2180.  lsl.l   #2,d0             ; BPTR * 4 = APTR
  2181.  move.l  d0,a0
  2182.  move.l  40(a0),d0         ; DeviceName
  2183.  lsl.l   #2,d0             ; BPTR * 4 = APTR
  2184.  move.l  d0,a2
  2185.  move.b  (a2)+,d1          ; first byte = Stringlength (BSTR)
  2186.  ext.w   d1                ; dbra uses word
  2187.  subq.w  #1,d1             ; dbra  -1
  2188. testdevice:
  2189.  cmpm.b  (a2)+,(a3)+
  2190.  bne.s   testgrossklein
  2191. teston:
  2192.  dbra    d1,testdevice
  2193.  cmp.b   #":",(a3)
  2194.  beq.s   isdevice
  2195.  moveq   #0,d0
  2196.  bra.s   searchend         ; for instance RAMM: statt RAM: eingegeben
  2197. isdevice:
  2198.  moveq   #-1,d0            ; Device exists -> d0 = $ffffffff
  2199.  bra.s   searchend
  2200. testgrossklein:            ; AmigaDOS does not distinguish capital/small letter
  2201.  add.b   #32,-(a3)
  2202.  subq.l  #1,a2
  2203.  cmpm.b  (a2)+,(a3)+       ; try it as a capital letter
  2204.  beq.s   teston
  2205.  sub.b   #64,-(a3)
  2206.  subq.l  #1,a2
  2207.  cmpm.b  (a2)+,(a3)+       ; try it as a small letter
  2208.  beq.s   teston
  2209.  add.b   #32,-(a3)         ; restore
  2210.  move.l  (a0),d0           ; no more device -> d0 = 0
  2211.  bne.s   nextdevice        ; NextDevice
  2212. searchend:
  2213.  move.l  $4.w,a6
  2214.  jsr     -138(a6)          ; okay -> d0=$ffffffff, if no devicename or
  2215.  movem.l (sp)+,d1-d7/a0-a6 ;                       if device exists.
  2216.  rts                       ; d0=0 -> device does not exist
  2217.  
  2218. OpenIntuition:             ; OpenLibrary("intuition.library",0);
  2219.  movem.l d1-d7/a0-a6,-(sp) ; changes d0,a6
  2220.  lea     intuition(pc),a1
  2221.  bra.s   shorter3
  2222.  
  2223. OpenDOS:                   ; OpenLibrary("dos.library",0);
  2224.  movem.l d1-d7/a0-a6,-(sp) ; changes d0,a6
  2225.  lea     dosname(pc),a1
  2226. shorter3:
  2227.  moveq   #0,d0             ; Version >= 0
  2228.  jsr     -552(a6)          ; OpenLibrary("intuition.library",0)
  2229.  movem.l (sp)+,d1-d7/a0-a6
  2230.  move.l  d0,a6             ; base -> a6
  2231.  rts                       ; ROM-Library -> always okay -> forget checking
  2232.  
  2233. CloseFile:
  2234.  jsr     -36(a6)           ; Close() file
  2235. CloseDOS:
  2236.  move.l  a6,a1
  2237.  move.l  $4.w,a6
  2238.  jmp     -414(a6)          ; CloseLibrary("dos.library",0) + rts
  2239.  
  2240. clearflags:
  2241.  lea     exitcount(pc),a0
  2242.  subq.b  #1,(a0)           ; exitcount -1  if disk-working is finished
  2243.  lea     inuse0(pc),a0     ; if exitcount=0  VIRUS-CONTROL can be finished
  2244.  add.l   d6,a0
  2245.  clr.b   (a0)              ; dfx: no more in use
  2246.  rts
  2247.  
  2248. settimer:                  ; prepare timer.device
  2249.  sub.l   a1,a1
  2250.  jsr     -294(a6)
  2251.  lea     timeport(pc),a1
  2252.  move.l  d0,16(a1)
  2253.  jsr     -354(a6)
  2254.  lea     timerdev(pc),a0
  2255.  lea     timereq(pc),a1    ; my task sends message(=request) to timerdevicetask
  2256.  moveq   #1,d0             ; when time is over, timerdevicetask sends message
  2257.  moveq   #0,d1             ; to port of my task, port-address stands in
  2258.  jsr     -444(a6)          ; message(request). my task is informed of the
  2259.  lea     timeport(pc),a3   ; arrived message, because my task-address stands
  2260.  lea     timereq(pc),a1    ; in port.
  2261.  move.l  a3,14(a1)
  2262.  rts
  2263.  
  2264. freemem:
  2265.  move.l  #end-reset+9000,d0 ; Bytesize
  2266.  move.l  pointer(pc),a1
  2267.  jmp     -210(a6)           ; FreeMem + rts
  2268.  
  2269. remreqport:
  2270.  lea     timereq(pc),a1
  2271.  jsr     -450(a6)          ; CloseDevice()
  2272.  lea     timeport(pc),a1
  2273.  jmp     -360(a6)          ; RemPort()
  2274.  
  2275. restoreopen:
  2276.  lea     jmpoldopen(pc),a0
  2277.  move.l  dosbase(pc),a4
  2278.  cmp.w   #$4ef9,-30(a4)
  2279.  bne.s   notchanged
  2280.  jsr     -120(a6)          ; Disable(), because theoretically task-switch
  2281.  move.w  (a0),-30(a4)      ; after 1 instruction
  2282.  move.l  8(a0),-28(a4)     ; retore Open()
  2283.  jsr     -126(a6)          ; Enable()
  2284. notchanged:
  2285.  rts
  2286.  
  2287. testfile:
  2288.  move.l  a5,d2             ; d2 = read-buffer
  2289.  move.l  #1024,d3          ; d3 = number of read-bytes
  2290.  movem.l d1-d7/a0-a6,-(sp)
  2291.  jsr     -42(a6)           ; Read()
  2292.  movem.l (sp)+,d1-d7/a0-a6
  2293.  rts
  2294.  
  2295. setend:                    ; return with d0=filelength
  2296.  moveq   #0,d2
  2297.  moveq   #1,d3             ; END
  2298.  bra     seekit
  2299.  
  2300. openflag:      dc.b $ff ; $ff->Open() is not set to VIRUSCONTROL by controlTask
  2301. opencount:     dc.b 0   ; number of OpenRequester, finish VControl only if = 0
  2302. colorflag:     dc.b $ff ; insert disk -> green color-signal
  2303. searchfiles:   dc.b $ff ; search S:NoWarning, S:VirusName-File
  2304. taskflag:      dc.b $ff ; $ff -> vector-control-task checks vectors at once
  2305. resetflag:     dc.b 0   ; to ignore first 512-Disk-DOIO
  2306. exitflag:      dc.b 0   ; VIRUS-CONTROL is to be finished
  2307. exitcount:     dc.b 0   ; exitcount=number of WarnWindows, finish VControl if=0
  2308. inuse0:        dc.b 0   ; if dfx:-inuse-flag is set->disk already worked on
  2309. inuse1:        dc.b 0   ; df1:
  2310. inuse2:        dc.b 0   ; df2:
  2311. inuse3:        dc.b 0   ; df3:
  2312. pointer:       dc.l 0   ; pointer to VIRUS-CONTROL (-memory)
  2313. BeginIOAdr:    dc.l 0   ; BeginIO-vector-address of trackdisk-device
  2314. lastBeginIO:   dc.l 0   ; last BeginIO-vector
  2315. restoreIO:     dc.l 0   ; remove systemvirus -> set this BeginIO-vector
  2316. lastKickMem:   dc.l 0
  2317. lastKickTag:   dc.l 0
  2318. lastKickCheck: dc.l 0
  2319. lastDOIO:      dc.l newdoio-reset ; if CLI-Start
  2320. lastCOOL:      dc.l reset-reset   ; if CLI-Start
  2321. freeposition:  dc.l 0
  2322. dosbase:       dc.l 0
  2323. onediff1:      dc.b 0
  2324. nochfrei:      dc.b 0
  2325. intuition:     dc.b "intuition.library",0
  2326.  even
  2327. timerdev:      dc.b "timer.device",0
  2328.  even
  2329. unknown:       dc.b "Virus-Name unknown !           ",0
  2330. unknownend:    even
  2331. NoWarning:     dc.b "S:NoWarning",0
  2332.  even
  2333. VirusName:     dc.b "S:VirusName",0
  2334.  even
  2335. Kennung:       dc.l $000003e8  ; hunk_name
  2336.                dc.l $00000002  ; Name 2 Longword long
  2337.                dc.b  "OIUS"    ; identification ( start Vcontrol -> PIUS)
  2338. Kennzahl:      dc.l $00000000  ; original filelength
  2339.                dc.l $000003f2  ; hunk_end
  2340. filename:
  2341.  dc.b "RAW:0/0/640/170/BOOTBLOCK-DF"
  2342. unit4:                       dc.b "0:  hit any key ",0
  2343.  even
  2344. ; in reset-boot-routine Topaz 9 (60 characters) -> RAW: y=170 to prevent
  2345. ; vertical scrolling.
  2346.  
  2347. NOBOOT:
  2348.  dc.b 1,0,0,0
  2349.  dc.w 7,8
  2350.  dc.l font-reset,NOBOOTtext-reset,0
  2351. NOBOOTtext:
  2352.  dc.b "Bootblock-Virus in DF"
  2353. unit0:         dc.b "0: ?       PUBLIC DOMAIN !! CONTACTS WELCOMED !!",0
  2354.  even
  2355. NAME0:
  2356.  dc.b 1,0,0,0
  2357.  dc.w 0,0
  2358.  dc.l font-reset,NAME0text-reset,0
  2359. NAME0text:
  2360.  dc.b "                               ",0
  2361.  even
  2362. NAME1:
  2363.  dc.b 1,0,0,0
  2364.  dc.w 0,0
  2365.  dc.l font-reset,NAME1text-reset,0
  2366. NAME1text:
  2367.  dc.b "                               ",0
  2368.  even
  2369. NAME2:
  2370.  dc.b 1,0,0,0
  2371.  dc.w 0,0
  2372.  dc.l font-reset,NAME2text-reset,0
  2373. NAME2text:
  2374.  dc.b "                               ",0
  2375.  even
  2376. NAME3:
  2377.  dc.b 1,0,0,0
  2378.  dc.w 0,0
  2379.  dc.l font-reset,NAME3text-reset,0
  2380. NAME3text:
  2381.  dc.b "                               ",0
  2382.  even
  2383. ONEDIFF:
  2384.  dc.b 1,0,0,0
  2385.  dc.w 0,0
  2386.  dc.l font-reset,ONEDIFFtext-reset,0
  2387. ONEDIFFtext:
  2388.  dc.b "1 Longword-difference",0
  2389.  even
  2390. OPENERR:
  2391.  dc.b 0,1,0,0
  2392.  dc.w 15,30
  2393.  dc.l font-reset,OPENERRtext-reset,0
  2394. OPENERRtext:
  2395.  dc.b "Warn-Window-DF"
  2396. unit3:         dc.b "0: Open-Error",0
  2397.  even
  2398. CORRECT:
  2399.  dc.b 0,1,0,0
  2400.  dc.w 15,30
  2401.  dc.l font-reset,CORRECTtext-reset,0
  2402. CORRECTtext:
  2403.  dc.b "String-Gadget-contents-DF"
  2404. unit5: dc.b "0: correct ? "
  2405. correctname:        dc.b "                                  ",0
  2406.  even
  2407. NOBOOTR:
  2408.  dc.b 0,1,0,0
  2409.  dc.w 7,4
  2410.  dc.l font-reset,NOBOOTRtext-reset,0
  2411. NOBOOTRtext: dc.b " END ",0
  2412.  even
  2413. PROTECT:
  2414.  dc.b 0,1,0,0
  2415.  dc.w 15,30
  2416.  dc.l 0,PROTECTtext-reset,0
  2417. PROTECTtext:
  2418.  dc.b "Disk in DF"
  2419. unit2:     dc.b "0: is write-protected !",0
  2420.  even
  2421. PROTECTL:
  2422.  dc.b 0,1,0,0
  2423.  dc.w 7,4
  2424.  dc.l 0,PROTECTLtext-reset,0
  2425. PROTECTLtext: dc.b " RETRY ",0
  2426.  even
  2427. ALREADYNO:
  2428.  dc.b 0,1,0,0
  2429.  dc.w 15,30
  2430.  dc.l 0,ALREADYNOtext-reset,0
  2431. ALREADYNOtext:
  2432.  dc.b "Bootblock DF"
  2433. unit6:       dc.b "0: already in S:NoWarning !",0
  2434.  even
  2435. ALREADYNOdel:
  2436.  dc.b 0,1,0,0
  2437.  dc.w 7,4
  2438.  dc.l 0,ALREADYNOdeltext-reset,0
  2439. ALREADYNOdeltext:
  2440.  dc.b " REMOVE ",0
  2441.  even
  2442. ALREADYVI:
  2443.  dc.b 0,1,0,0
  2444.  dc.w 15,30
  2445.  dc.l font-reset,ALREADYVItext-reset,0
  2446. ALREADYVItext:
  2447.  dc.b "Bootblock DF"
  2448. unit7:       dc.b "0: already in S:VirusName: "
  2449. oldname:                              dc.b "                               ",0
  2450.  even
  2451. ALREADYWORK:
  2452.  dc.b 0,1,0,0
  2453.  dc.w 7,4
  2454.  dc.l 0,ALREADYWORKtext-reset,0
  2455. ALREADYWORKtext:
  2456.  dc.b " REMOVE or OVERWRITE ",0
  2457.  even
  2458. ALREADYNOnam:
  2459.  dc.b 0,1,0,0
  2460.  dc.w 7,4
  2461.  dc.l font-reset,ALREADYNOnamtext-reset,0
  2462. ALREADYNOnamtext:
  2463.  dc.b " OVERWRITE with "
  2464. nameoverwrite:       dc.b "                               ",0
  2465.  even
  2466. OPENFILEnam:
  2467.  dc.b 0,1,0,0
  2468.  dc.w 15,30
  2469.  dc.l font-reset,OPENFILEnamtext-reset,0
  2470. OPENFILEnamtext:
  2471.  dc.b "ATTENTION: ACCESS to "
  2472. filewrite:           dc.b "                               ",0
  2473.  even
  2474. EXIT:
  2475.  dc.b 0,1,0,0
  2476.  dc.w 15,30
  2477.  dc.l 0,EXITtext-reset,0
  2478. EXITtext:
  2479.  dc.b "finish VIRUS-CONTROL really ?",0
  2480.  even
  2481. neusch:
  2482.  dc.b 0,1,0,0
  2483.  dc.w 7,4
  2484.  dc.l 0,neuschtext-reset,0
  2485. neuschtext:
  2486.  dc.b " Protect ",0
  2487.  even
  2488. okk:
  2489.  dc.b 0,1,0,0
  2490.  dc.w 7,4
  2491.  dc.l 0,okktext-reset,0
  2492. okktext:
  2493.  dc.b " File okay ",0
  2494.  even
  2495. noloadf:
  2496.  dc.b 0,1,0,0
  2497.  dc.w 15,30
  2498.  dc.l 0,noloadftext-reset,0
  2499. noloadftext:
  2500.  dc.b "no load-file: "
  2501. keinloadfile:        dc.b "                               ",0
  2502.  even
  2503. FILESCHUTZ:
  2504.  dc.b 0,1,0,0
  2505.  dc.w 15,30
  2506.  dc.l 0,FILESCHUTZtext-reset,0
  2507. FILESCHUTZtext:
  2508.  dc.b "File-Protection: "
  2509. checkfilename:       dc.b "                               ",0
  2510.  even
  2511. link:
  2512.  dc.b 0,1,0,0
  2513.  dc.w 15,30
  2514.  dc.l font-reset,linktext-reset,0
  2515. linktext:
  2516.  dc.b "Filelength has changed !! -> LINK-VIRUS ?? -> "
  2517. linkname: dc.b "                               ",0
  2518.  even
  2519. WRITEBB:
  2520.  dc.b 0,1,0,0
  2521.  dc.w 15,30
  2522.  dc.l font-reset,WRITEBBtext-reset,0
  2523. WRITEBBtext:
  2524.  dc.b "ATTENTION: WRITE-ACCESS to Bootblock DF"
  2525. unit8:                                   dc.b "0:  turn to READ ?",0
  2526.  even
  2527. OVERWRITE:
  2528.  dc.b 0,1,0,0
  2529.  dc.w 15,30
  2530.  dc.l 0,OVERWRITEtext-reset,0
  2531. OVERWRITEtext:
  2532.  dc.b "Bootblock  in DF"
  2533. unit1:          dc.b "0: really write over it ?",0
  2534.  even
  2535. OVERWRITEL:
  2536.  dc.b 0,1,0,0
  2537.  dc.w 7,4
  2538.  dc.l 0,OVERWRITELtext-reset,0
  2539. OVERWRITELtext: dc.b " YES ",0
  2540.  even
  2541. OVERWRITER:
  2542.  dc.b 0,1,0,0
  2543.  dc.w 7,4
  2544.  dc.l 0,OVERWRITERtext-reset,0
  2545. OVERWRITERtext: dc.b "  NO  ",0
  2546.  even
  2547. BOOT:
  2548.  dc.b 0,1,0,0
  2549.  dc.w 15,30
  2550.  dc.l 0,NOBOOTtext-reset,0
  2551. BOOTL:
  2552.  dc.b 0,1,0,0
  2553.  dc.w 7,4
  2554.  dc.l 0,BOOTLtext-reset,0
  2555. BOOTLtext: dc.b " Disk-Boot-Routine ",0
  2556.  even
  2557. BOOTR:
  2558.  dc.b 0,1,0,0
  2559.  dc.w 7,4
  2560.  dc.l 0,BOOTRtext-reset,0
  2561. BOOTRtext: dc.b " Boot-Simulation ",0
  2562.  even
  2563. REALLYBOOT:
  2564.  dc.b 0,1,0,0
  2565.  dc.w 15,30
  2566.  dc.l 0,REALLYBOOTtext-reset,0
  2567. REALLYBOOTtext:
  2568.  dc.b "left: could start a Disk-Boot-VIRUS !!",0
  2569.  even
  2570.  
  2571. vector0:
  2572.  dc.b 0,1,0,0
  2573.  dc.w 15,30
  2574.  dc.l 0,vector0text-reset,0
  2575. vector0text: dc.b "       -vector changed -> VIRUS ? - AMIGA OFF !!",0
  2576.  even
  2577. vectorL:
  2578.  dc.b 0,1,0,0
  2579.  dc.w 7,4
  2580.  dc.l font-reset,vectorLtext-reset,0  ; Topaz80 da > 60 Zeichen
  2581. vectorLtext:
  2582.  dc.b " KILL-SYSTEM-VIRUS -> Danger of Guru -> better AMIGA OFF !! ",0
  2583.  even
  2584.  
  2585. gadtext16:
  2586.  dc.b 1,0,0,0
  2587.  dc.w 7,3
  2588.  dc.l font-reset,gadtext16text-reset,0
  2589. gadtext16text: dc.b " SearchFiles   ON ",0
  2590.  even
  2591. gadtext15:
  2592.  dc.b 1,0,0,0
  2593.  dc.w 7,3
  2594.  dc.l font-reset,gadtext15text-reset,0
  2595. gadtext15text: dc.b "  CheckOpen   OFF ",0
  2596.  even
  2597. gadtext14:
  2598.  dc.b 1,0,0,0
  2599.  dc.w 7,3
  2600.  dc.l font-reset,gadtext14text-reset,0
  2601. gadtext14text:dc.b " File - Protection",0
  2602.  even
  2603. gadtext13:
  2604.  dc.b 1,0,0,0
  2605.  dc.w 7,3
  2606.  dc.l font-reset,gadtext13text-reset,0
  2607. gadtext13text:dc.b " Kill System-Virus",0
  2608.  even
  2609. gadtext12:
  2610.  dc.b 1,0,0,0
  2611.  dc.w 7,3
  2612.  dc.l font-reset,gadtext12text-reset,0
  2613. gadtext12text:dc.b "in S:VirusName-File",0
  2614.  even
  2615. gadtext11:
  2616.  dc.b 1,0,0,0
  2617.  dc.w 7,3
  2618.  dc.l font-reset,gadtext11text-reset,0
  2619. gadtext11text:dc.b "in S:NoWarning-File",0
  2620.  even
  2621. gadtext8:
  2622.  dc.b 1,0,0,0
  2623.  dc.w 7,3
  2624.  dc.l font-reset,gadtext8text-reset,0
  2625. gadtext8text: dc.b "Finish VirusControl",0
  2626.  even
  2627. gadtext7:
  2628.  dc.b 1,0,0,0
  2629.  dc.w 7,3
  2630.  dc.l font-reset,gadtext7text-reset,0
  2631. gadtext7text: dc.b "r.Checksum ->  Boot",0
  2632.  even
  2633. gadtext6:
  2634.  dc.b 1,0,0,0
  2635.  dc.w 7,3
  2636.  dc.l font-reset,gadtext6text-reset,0
  2637. gadtext6text: dc.b "f.Checksum ->NoBoot",0
  2638.  even
  2639. gadtext5:
  2640.  dc.b 1,0,0,0
  2641.  dc.w 7,3
  2642.  dc.l font-reset,gadtext5text-reset,0
  2643. gadtext5text: dc.b "NoFastMem-BootBlock",0
  2644.  even
  2645. gadtext4:
  2646.  dc.b 1,0,0,0
  2647.  dc.w 7,3
  2648.  dc.l font-reset,gadtext4text-reset,0
  2649. gadtext4text: dc.b "Standard -BootBlock",0
  2650.  even
  2651. gadtext3:
  2652.  dc.b 1,0,0,0
  2653.  dc.w 7,3
  2654.  dc.l font-reset,gadtext3text-reset,0
  2655. gadtext3text: dc.b "File   -> BootBlock",0
  2656.  even
  2657. gadtext2:
  2658.  dc.b 1,0,0,0
  2659.  dc.w 7,3
  2660.  dc.l font-reset,gadtext2text-reset,0
  2661. gadtext2text: dc.b "Bootblock ->   File",0
  2662.  even
  2663. gadtext1:
  2664.  dc.b 1,0,0,0
  2665.  dc.w 7,3
  2666.  dc.l font-reset,gadtext1text-reset,0
  2667. gadtext1text: dc.b "BootBlock -> Screen",0
  2668.  even
  2669. gadtext0:
  2670.  dc.b 1,0,0,0
  2671.  dc.w 7,3
  2672.  dc.l font-reset,gadtext0text-reset,0
  2673. gadtext0text: dc.b  " Color-Signal  ON ",0
  2674.  even
  2675.  
  2676. gad16:            ; search files
  2677.  dc.l 0
  2678.  dc.w 430,6*18+48,166,12,0,1,1
  2679.  dc.l gadborder-reset,0,gadtext16-reset,0,0
  2680.  dc.w 16
  2681.  dc.l 0
  2682. gad15:            ; Check Open
  2683.  dc.l gad16-reset
  2684.  dc.w 430,5*18+48,166,12,0,1,1
  2685.  dc.l gadborder-reset,0,gadtext15-reset,0,0
  2686.  dc.w 15
  2687.  dc.l 0
  2688. gad14:            ; protect files
  2689.  dc.l gad15-reset
  2690.  dc.w 430,3*18+43,166,12,0,1,1
  2691.  dc.l gadborder-reset,0,gadtext14-reset,0,0
  2692.  dc.w 14
  2693.  dc.l 0
  2694. gad13:            ; Kill System-Virus
  2695.  dc.l gad14-reset
  2696.  dc.w 230,6*18+48,166,12,0,1,1
  2697.  dc.l gadborder-reset,0,gadtext13-reset,0,0
  2698.  dc.w 13
  2699.  dc.l 0
  2700. gad12:           ; in S:VirusName-File
  2701.  dc.l gad13-reset
  2702.  dc.w 230,3*18+43,166,12,0,1,1
  2703.  dc.l gadborder-reset,0,gadtext12-reset,0,0
  2704.  dc.w 12
  2705.  dc.l 0
  2706. gad11:           ; in S:NoWarning-File
  2707.  dc.l gad12-reset
  2708.  dc.w 230,2*18+43,166,12,0,1,1
  2709.  dc.l gadborder-reset,0,gadtext11-reset,0,0
  2710.  dc.w 11
  2711.  dc.l 0
  2712. gad10:
  2713.  dc.l gad11-reset
  2714.  dc.w 30,1*18-3,566,53,3,1,1  ; GADGHNONE since only information
  2715.  dc.l gadborder1-reset,0,NOBOOT-reset,0,0
  2716.  dc.w 10
  2717.  dc.l 0
  2718. gad8:            ; finish Virus-Control
  2719.  dc.l gad10-reset
  2720.  dc.w 430,2*18+43,166,12,0,1,1
  2721.  dc.l gadborder-reset,0,gadtext8-reset,0,0
  2722.  dc.w 8
  2723.  dc.l 0
  2724. gad7:            ; (Virus)DiskBoot  ON
  2725.  dc.l gad8-reset
  2726.  dc.w 230,5*18+48,166,12,0,1,1
  2727.  dc.l gadborder-reset,0,gadtext7-reset,0,0
  2728.  dc.w 7
  2729.  dc.l 0
  2730. gad6:            ; (Virus)DiskBoot OFF
  2731.  dc.l gad7-reset
  2732.  dc.w 230,4*18+48,166,12,0,1,1
  2733.  dc.l gadborder-reset,0,gadtext6-reset,0,0
  2734.  dc.w 6
  2735.  dc.l 0
  2736. gad5:            ; NoFastMem-BootBlock
  2737.  dc.l gad6-reset
  2738.  dc.w 30,6*18+48,166,12,0,1,1
  2739.  dc.l gadborder-reset,0,gadtext5-reset,0,0
  2740.  dc.w 5
  2741.  dc.l 0
  2742. gad4:            ; Standard -BootBlock
  2743.  dc.l gad5-reset
  2744.  dc.w 30,5*18+48,166,12,0,1,1
  2745.  dc.l gadborder-reset,0,gadtext4-reset,0,0
  2746.  dc.w 4
  2747.  dc.l 0
  2748. gad3:            ; File   -> BootBlock
  2749.  dc.l gad4-reset
  2750.  dc.w 30,4*18+48,166,12,0,1,1
  2751.  dc.l gadborder-reset,0,gadtext3-reset,0,0
  2752.  dc.w 3
  2753.  dc.l 0
  2754. gad2:            ; Bootblock ->   File
  2755.  dc.l gad3-reset
  2756.  dc.w 30,3*18+43,166,12,0,1,1
  2757.  dc.l gadborder-reset,0,gadtext2-reset,0,0
  2758.  dc.w 2
  2759.  dc.l 0
  2760. gad1:            ; BootBlock -> screen
  2761.  dc.l gad2-reset
  2762.  dc.w 30,2*18+43,166,12,0,1,1
  2763.  dc.l gadborder-reset,0,gadtext1-reset,0,0
  2764.  dc.w 1
  2765.  dc.l 0
  2766. gad0:            ; colorsignal
  2767.  dc.l gad1-reset
  2768.  dc.w 430,4*18+48,166,12,0,1,1
  2769.  dc.l gadborder-reset,0,gadtext0-reset,0,0
  2770.  dc.w 0
  2771.  dc.l 0
  2772.  
  2773. gad90:                                     ; 4 stringadgets, because of
  2774.  dc.l gad0-reset                           ; reentrance df0: - df3:
  2775.  dc.w 37,8*18+38,566,12,0,1,4              ; stringgadget will be FirstGadget
  2776.  dc.l gadborders-reset,0,0,0,string0-reset
  2777.  dc.w 9
  2778.  dc.l 0
  2779. string0:
  2780.  dc.l buff0-reset,undo0-reset
  2781.  dc.w 0,buff1-buff0,0,0,0,0,0,0
  2782.  dc.l 0,0,0
  2783. gad91:
  2784.  dc.l gad0-reset
  2785.  dc.w 37,8*18+38,566,12,0,1,4
  2786.  dc.l gadborders-reset,0,0,0,string1-reset
  2787.  dc.w 9
  2788.  dc.l 0
  2789. string1:
  2790.  dc.l buff1-reset,undo1-reset
  2791.  dc.w 0,buff1-buff0,0,0,0,0,0,0
  2792.  dc.l 0,0,0
  2793. gad92:
  2794.  dc.l gad0-reset
  2795.  dc.w 37,8*18+38,566,12,0,1,4
  2796.  dc.l gadborders-reset,0,0,0,string2-reset
  2797.  dc.w 9
  2798.  dc.l 0
  2799. string2:
  2800.  dc.l buff2-reset,undo2-reset
  2801.  dc.w 0,buff1-buff0,0,0,0,0,0,0
  2802.  dc.l 0,0,0
  2803. gad93:
  2804.  dc.l gad0-reset
  2805.  dc.w 37,8*18+38,566,12,0,1,4
  2806.  dc.l gadborders-reset,0,0,0,string3-reset
  2807.  dc.w 9
  2808.  dc.l 0
  2809. string3:
  2810.  dc.l buff3-reset,undo3-reset
  2811.  dc.w 0,buff1-buff0,0,0,0,0,0,0
  2812.  dc.l 0,0,0
  2813.  
  2814. gadborder:           ; all Gadgets, execept Stringgadget and top-Gadget
  2815.  dc.w -1,-1
  2816.  dc.b 2,1,0,18
  2817.  dc.l pairs-reset,0
  2818. gadborders:          ; Stringgadget
  2819.  dc.w -8,-4          ; GadgetID = 9
  2820.  dc.b 2,1,0,18
  2821.  dc.l pairss-reset,0
  2822. gadborder1:          ; large-top-Information-Gadget
  2823.  dc.w -1,-1          ; GadgetID = 10
  2824.  dc.b 2,1,0,18
  2825.  dc.l pairs1-reset,0
  2826.  
  2827. pairs:               ; shadow by borderlines
  2828.  dc.w 0,13, 0,0, 167,0, 167,13, 0,13, 1,14, 168,14, 168,0, 169,1,
  2829.  dc.w 169,15, 170,15, 170,2, 171,3, 171,15, 2,15, 3,16, 172,16, 172,4
  2830. pairss:
  2831.  dc.w 0,13, 0,0, 567,0, 567,13, 0,13, 1,14, 568,14, 568,0, 569,1,
  2832.  dc.w 569,15, 570,15, 570,2, 571,3, 571,15, 2,15, 3,16, 572,16, 572,4
  2833. pairs1:
  2834.  dc.w 0,54, 0,0, 567,0, 567,54, 0,54, 1,55, 568,55, 568,0, 569,1,
  2835.  dc.w 569,56, 570,56, 570,2, 571,3, 571,56, 2,56, 3,57, 572,57, 572,4
  2836.  
  2837. font:                   ; some requester-texts are to long for Topaz 60
  2838.  dc.l topazfont-reset
  2839.  dc.w 8
  2840.  dc.b 0,1
  2841. topazfont: dc.b "topaz.font",0
  2842.  even
  2843.  
  2844. ; 4 Stringgadget-buffer, because of reentrance df0: - df3:
  2845. buff0: dc.b "ram:filename",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; 32 Bytes
  2846. buff1: dc.b "ram:filename",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; is even
  2847. buff2: dc.b "ram:filename",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  2848. buff3: dc.b "ram:filename",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  2849.  
  2850. window:            ; New-Window-structure of Warn-Window
  2851.  dc.w 0,0,640,200
  2852.  dc.b 0,1          ; CLOSEWINDOW|GADGETUP
  2853.  dc.l $240,$100f,0 ; ACTIVATE|W.DEPTH|W.DRAG|W.CLOSE|W.SIZING|SMART_REFRESH
  2854.  dc.l 0,taskname-reset,0,0
  2855.  dc.w 290,68,640,200,1 ; WBENCHSCREEN
  2856.  ; WINDOWSIZING -> do not destroy PrintIText, SMART_REFRESH does not restore
  2857. structtask: dc.l 0,0
  2858.             dc.b 1,0
  2859.             dc.l taskname-reset
  2860.             dc.b 0,0,0,0
  2861.             dc.l 0,0,0,0
  2862.             dc.w 0,0
  2863.             dc.l 0,0,0,0
  2864.             dc.l end-reset+9000,end-reset,end-reset+9000
  2865.             dc.l 0,0,0,0,0
  2866.             dc.w 0,0,0
  2867. end:
  2868. ; +9000 Bytes duch AllocMem belegen.
  2869. ; end       bis end+1024             Bootblock-buffer for NoWarning-Funktion
  2870. ; end+1024  bis end+2*1024+32        Bootblock-buffer for VirusName-Funktion
  2871. ; end+2080  bis end+2080+128         4 * 32-byte-String-Gadget-Undo-buffer
  2872. ; end+2208  bis end+2208+40+48+2*34  2*Request-structure,2*Port-structure
  2873. ; end+2364  bis end+2364+512         512-byte-Sektor-buffer for -t Option
  2874. ; end+2876  bis end+2876+1024        1024-byte-Bootblock-buffer for df0:
  2875. ; end+3900  bis end+3900+1024        1024-byte-Bootblock-buffer for df1:
  2876. ; end+4924  bis end+4924+1024        1024-byte-Bootblock-buffer for df2:
  2877. ; end+5948  bis end+5948+1024        1024-byte-Bootblock-buffer for df3:
  2878. ; end+6972  bis end+9000             vector-control-Task-Stack
  2879. ; vector-control-Task uses jsr AutoRequest() -> needs 1.2 KB Stack
  2880. ; 9000-6972 = 2028  Stack is enough.
  2881. Nobuff      = end
  2882. Vibuff      = Nobuff+1024
  2883. undo0       = Vibuff+1024+32
  2884. undo1       = undo0+32
  2885. undo2       = undo1+32
  2886. undo3       = undo2+32
  2887. timereq     = undo3+32         ; IORequest(32)+timeval(8) -> AllocMem
  2888. timeport    = timereq+40       ; MsgPort(34)              -> MEMF_CLEAR
  2889. trackreq    = timeport+34      ; IOStdRequest(48)
  2890. trackport   = trackreq+48      ; MsgPort(34)
  2891. blockbuff   = trackport+34
  2892. bootblock0  = blockbuff+512;
  2893. bootblock1  = bootblock0+1024
  2894. bootblock2  = bootblock1+1024
  2895. bootblock3  = bootblock2+1024
  2896.